# Run Test Cases source: https://developer.mastercard.com/consumer-clarity/documentation/testing/run-test-cases/index.md ## Overview {#overview} This section provides guidance for using different tools to test the sample request data. Postman is Mastercard's recommended tool for testing. See [How Mastercard Leverages Postman](https://developer.mastercard.com/blog/how-mastercard-leverages-postman/) for details. You can also choose to run these test cases through a different tool or process, such as Insomnia. This article provides details for both options. ## Run Test Cases using Postman {#run-test-cases-using-postman} Follow these steps to use Postman to run the Consumer Clarity test cases: 1. Go to . 2. Select the **Ethoca Customers** workspace and follow the instructions for getting started. See [Postman Collection](https://developer.mastercard.com/consumer-clarity/documentation/postman-collection/index.md) for additional details. ## Run Test Cases using Insomnia {#run-test-cases-using-insomnia} Follow these steps to install, configure, and use Insomnia to run the test cases provided in this article. ### What you need {#what-you-need} * [Insomnia CORE](https://insomnia.rest/), or a similar API testing tool * Most recent version of our [JSON test case file](https://static.developer.mastercard.com/content/consumer-clarity/uploads/Consumer_Clarity_Customer_Test_Payloads.json) (If necessary, right-click and save) Note: All test cases provided in the JSON test case file are for the Consumer Clarity service only. Therefore, they return a **Purchase receipt not accessible** message. ### Install and configure Insomnia {#install-and-configure-insomnia} 1. Download the Insomnia tool from [Insomnia REST Website](https://insomnia.rest/download). 2. Install the Mastercard plugin. 3. Open Insomnia. 4. Go to **Application** \> **Preferences** \> **Plugins**. 5. In the search bar, type *insomnia-plugin-mastercard-auth* . ![Enter plugin name in the search bar](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-plugin.png) 6. Select **Install Plugin** . Note: If you receive an error while installing the plugin, see the instructions for how to [Manually Install the Mastercard Plugin](https://developer.mastercard.com/donations/tutorial/how-to-install-and-configure-insomnia-tool/install-the-plug-in/). ### Update your environment {#update-your-environment} 1. In the Insomnia main window, select **No Environment** and then select **Manage Environments** from the drop down. ![Insomnia window select manage environments](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-environment.png) 2. Select the plus sign ( **+** ) next to **Sub Environment** and then select **Private Environment** . ![Create a new environment](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-private-environment.png) 3. In the panel to the right, select **New Environment** and enter a name for your environment, such as **Mastercard** . ![Name the new environment](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-create-new-environment.png) 4. In your new environment, add the sandbox credentials you received when you [created your project](https://developer.mastercard.com/consumer-clarity/documentation/tutorials-and-guides/quick-start-guide/index.md). Enter them in the following format. ```json { "mastercard": { "consumerKey": "", "keyAlias": "keyalias", "keystoreP12Path": "/path/to/sandbox-signing-key.p12", "keystorePassword": "keystorepassword" } } ``` ![Example of how to enter Mastercard credentials into the Insomnia window](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-create-new-environment-filled-in.png) ### Import the test cases {#import-the-test-cases} 1. If you haven't already done so, download this JSON file containing the test cases: [Consumer_Clarity_Customer_Test_Payloads.json](https://static.developer.mastercard.com/content/consumer-clarity/uploads/Consumer_Clarity_Customer_Test_Payloads.json) (14KB). (If necessary, right-click and save the file to download it). 2. In Insomnia, select **Application** \> **Preferences**. 3. On the Data tab, select **Import Data** \> **From file** and go to the *Consumer_Clarity_Customer_Test_Payloads.json* test case file you just downloaded. 4. Select the environment where you entered your sandbox credential information. In our example, the environment is **Mastercard**. 5. Verify that **POST** and `https://sandbox.api.mastercard.com/ethoca/consumer-clarity/searches` are displayed and then select **Send** . ![Select POST request type and verify resource location](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-send-post-request.png) At this point, you can choose any of the test cases listed in the panel on the left and select **Send**. The request and response are displayed in the panels to the right. ![Example of how to run the different test cases](https://static.developer.mastercard.com/content/consumer-clarity/documentation/img/insomnia-test-result.png) ## Next Steps {#next-steps} * [API Reference](https://developer.mastercard.com/consumer-clarity/documentation/api-reference/index.md#apis) provides details about all of the fields and values in the Consumer Clarity and Smart Subscriptions APIs. * See [Code and Formats](https://developer.mastercard.com/consumer-clarity/documentation/code-and-formats/index.md) for detailed information about error response handling.