Creating Metadata Connections


In Testsigma, you can create a Salesforce application and establish a Metadata connection, which enables you to perform various actions like retrieving metadata, updating configurations, creating custom objects, and managing other components that define how the application behaves. This article discusses creating a metadata connection in Testsigma.


Prerequisites

Before you begin, ensure you have a Salesforce organization setup with a Salesforce Connected App.


Steps to Create Metadata Connection

  1. Click on Create metadata connection on Salesforce connections page. Create Metadata
  2. This will open the Metadata connection prompt. Prompt
  3. On Metadata connection prompt,

    • Enter Connection name, which is generally the user role you connect through, e.g., Admin. Name

      NOTE:

      You can also choose a custom name for the connection.

    • Choose the Production / Developer edition, if you’re testing the product environment or Sandbox, if you’re testing the staging environment from Connect with dropdown. Edition
    • Choose the Authentication type from the dropdown. In this example, we are choosing OAuth 2.0. Authentication

      ℹ️Authentication Types:
      There are two ways to Authenticate:
      • User name & Password: For User name & Password, enter Username, Password, Security token, Consumer key, and Consumer secret.
      • OAuth: For OAuth, enter Username, Consumer key, and Consumer secret.
      • Callback URL: Use the below mentioned Callback URL.

        https://salesforce-callback.testsigma.com/authorize/
  4. Click on Authorise & Connect. Authorise
  5. A new window will open up requesting for Salesforce Login. Enter the credentials and click on Log In. Login
  6. This will display the Environment associated with the credentials. Click on Start metadata sync. Start MD
  7. Wait until the sync is complete. This will take some time. Wait
  8. Once Metadata sync is successful, you can create test cases by clicking Create Test Case. Create Tests

Steps to Add Multiple Metadata Connections

  1. Navigate to Settings > SF Metadata. SF Metadata
  2. Select a Project and Application from the dropdown menu where you want to add metadata connections. Select Project & App
  3. Click Add New. This will open the Metadata Connection dialog. Add New
  4. Follow the steps in Creating Salesforce Metadata Connections to add the Metadata Connections. Metadata Connection
NOTE:

You can also copy existing metadata from multiple metadata connections added in older versions while creating a new version by following these steps.


  1. Go to Project > Project Settings > Versions, and click New Version. New Version
  2. Enter a Name and optional Description. Name & Description
  3. Go to Projects, and then navigate to the newly created Version. The system redirects you to the Salesforce Connections page. Salesforce Connections

    • Click Select Existing Metadata Connection to copy metadata from a previous version.
    • Click Create Metadata Connection to create a new metadata connection.

Executing Test Case against a Salesforce Metadata Connection

  1. Create a Test Case and click Run on the Action Panel. Run Test Case
NOTE:

Before you configure Ad-Hoc Run, you need to add user connections as Environments in Testsigma. For information on creating Environments, see Environments. User Connection Envs

  1. On the Ad-Hoc Run overlay,

    • Select an Environment with which the user connection is linked in the test steps.
    • Select a Salesforce Metadata Connection against which you want to execute the test case.

    Ad-Hoc Run

NOTE:

You can also configure the same for Test Plans in Test Plan Settings > Additional Settings by selecting Environment and a Salesforce Metadata Connection. SF Metadata


Steps to Edit Metadata Connection

  1. From the Dashboard, click on SF Connections. Edit Metadata
  2. In the Metadata connection section, hover over the connection, click on the kebab menu, and choose Edit connection from the dropdown menu. Edit Connection
  3. On the Metadata connection prompt, make the necessary changes and click on Authorise & Connect. Metadata Connection
NOTE:

You can not update the Metadata connection with a different environment.


Steps to Refresh Metadata Connection

To refresh metadata, you have two options:

  1. From the Dashboard, go to SF Connections and click on Refresh Metadata. Refresh
  2. Click on Refresh Metadata directly from the dashboard. Refresh
NOTE:

You can also refresh metadata using API. For more details, see Salesforce Metadata Refresh Using API.


Activity Logs

The activity log tab on the connection details page displays the information about all metadata sync triggers status, and the start time of metadata edit/refresh triggers. This article discusses the activity logs in the Salesforce metadata connection.

Steps to View Metadata Activity Logs

  1. Navigate to SF connections and click on Activity log. This will open the Activity log dialog. Activity Log
  2. The Activity log dialog displays information regarding past metadata sync triggers. Logs

Refer to this Salesforce troubleshooting guide for the most common issues while creating the metadata connection.