---
schema_version: "1"
id: 9e6f9a1d9f76d63bfba4de6e562a0ffe7d4563066f71459a08997e27ec733892
title: Create an Example Test Procedure
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_create_an_example_test_procedure_55559.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_create_an_example_test_procedure_55559.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 1a94ce961f8a95e600e9a35eeaa6892949ec7762a8dbca40faa19c0bb5ea74ab
description: After you mock a response in the Integration Procedure to be tested, create the Test Procedure that tests a calculation it performs.
products:
  - Omnistudio
release: "264"
---
# Create an Example Test Procedure

After you mock a response in the Integration Procedure to be tested, create the Test Procedure that tests a calculation it performs.

The Test Procedure has these components:

- A Set Values component, named IPInput
- An Integration Procedure Action component, named TestIP
- An Assert Action, named AssertTotal
- A Response Action, named TestResponse

A Response Action isn't required, but it's useful for testing the Test Procedure. After you have verified that the Test Procedure works, you can deactivate or delete it.

The Structure panel looks like this:

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/iptest1structure.png)

To create the Test Procedure:

1. From the Omnistudio Integration Procedures tab, click **New**.
2. Provide an **Integration Procedure Name**, a **Type**, and a **SubType**, and click **Save**.
3. Scroll to the bottom of the Procedure Configuration and check **Is Test Procedure**.
4. Drag a Set Values component into the Structure panel and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e134">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e140">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e134 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e140 ">
                  <p style="margin-bottom:0;">IPInput</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e134 ">
                  <p style="margin-bottom:0;">Element Value Map: Price</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e140 ">
                  <p style="margin-bottom:0;">250</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e134 ">
                  <p style="margin-bottom:0;">Element Value Map: State</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e140 ">
                  <p style="margin-bottom:0;">NY</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e134 ">
                  <p style="margin-bottom:0;">Response JSON Node</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e140 ">
                  <p style="margin-bottom:0;">IPInput</p>
                </td>

              </tr>
            </tbody>
          </table>
5. Drag an Integration Procedure Action component into the Structure panel and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e232">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e238">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e232 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e238 ">
                  <p style="margin-bottom:0;">TestIP</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e232 ">
                  <p style="margin-bottom:0;">Integration Procedure</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e238 ">
                  <p style="margin-bottom:0;">Name you gave the Integration Procedure to be tested, described in <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_define_execution_logic_using_conditional_blocks_48515.htm&amp;release=264.0.0&amp;type=5" title="Define conditional flow in Integration Procedures by using the Execution Conditional Formula field on an action or block, or by using a Conditional Block to compose a series of mutually exclusive conditions.">Define Execution Logic</a>. </p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e232 ">
                  <p style="margin-bottom:0;">Send JSON Path</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e238 ">
                  <p style="margin-bottom:0;">IPInput</p>
                </td>

              </tr>
            </tbody>
          </table>
6. Drag an Assert Action component into the Structure panel and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e323">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e329">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e323 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e329 ">
                  <p style="margin-bottom:0;">AssertTotal</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e323 ">
                  <p style="margin-bottom:0;">Assert Conditional Formula</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e329 ">
                  <p style="margin-bottom:0;">TestIP:Output:Total == 265</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e323 ">
                  <p style="margin-bottom:0;">Assert Failure Message</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e329 ">
                  <p style="margin-bottom:0;">Calculation is incorrect.</p>
                </td>

              </tr>
            </tbody>
          </table>
7. Drag a Response Action component into the Structure panel and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e406">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d67969e412">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e406 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e412 ">
                  <p style="margin-bottom:0;">TestResponse</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e406 ">
                  <p style="margin-bottom:0;">Return Full Data JSON</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d67969e412 ">
                  <p style="margin-bottom:0;">(checked)</p>
                </td>

              </tr>
            </tbody>
          </table>
    
    After you have verified that the Test Procedure works, you can deactivate this component.
8. Go to the Preview tab and click **Execute**. The output should look like this:
    
    ```
    {
      "response": {
        "testResult": "success"
      },
      "TestResponseStatus": true,
      "AssertTotal": {
        "assertFailureMessage": "Calculation is incorrect.",
        "variableData": {
          "TestIP:Output:Total": 265
        },
        "assertConditionalFormula": "TestIP:Output:Total == 265",
        "assertResult": true
      },
      "AssertTotalStatus": true,
      "TestIP": {
        "testResult": "success",
        "Output": {
          "Price": 250,
          "State": "NY",
          "Tax": 15,
          "TaxRate": 6,
          "Total": 265
        }
      },
      "TestIPStatus": true,
      "IPInput": {
        "Price": 250,
        "State": "NY"
      },
      "IPInputStatus": true,
      "options": {
        "useQueueableApexRemoting": false,
        "queueableChainable": false,
        "ignoreCache": true,
        "resetCache": false,
        "chainable": false
      }
    }
    ```
9. (Optional) In the IPInput component, change the Price, or change the State to WA, OR, NV, or CA. Then return to the Preview tab and click **Execute** again. Note how the output changes.
10. Prepare for [running the Test Procedure](https://help.salesforce.com/s/articleView?id=xcloud.os_create_an_example_test_procedure_55559.htm&type=5&language=en_US).
    1. In the TestResponse component, click **Active** to remove the check.
    2. In the Procedure Configuration, click **Activate Version**. IDX Workbench only runs active Test Procedures.

#### See Also

- [Test Procedures: Integration Procedures for Unit Testing](https://help.salesforce.com/s/articleView?id=xcloud.os_test_proceduresintegration_procedures_for_unit_testing_55410.htm&release=264.0.0&type=5 "An Integration Procedure that performs a unit test is a Test Procedure. You can use a Test Procedure to unit test almost anything an Integration Procedure can invoke, such as an Omnistudio Data Mapper, a Calculation Matrix, an Apex class, or another Integration Procedure.")
- [Workflow for Test Procedure Example](https://help.salesforce.com/s/articleView?id=xcloud.os_workflow_for_test_procedure_example_55479.htm&release=264.0.0&type=5 "A Test Procedure tests a calculation performed by another Integration Procedure.")