Recording a Test from an Exchange Example | MuleSoft Documentation
# Recording a Test from an Exchange Example
Anypoint Studio 
The following example shows you how to import to Anypoint Studio an existing project from Anypoint Exchange and then record the flow processing to create a unit test for the flows.
## Prerequisite
  * Your Anypoint Platform credentials are configured in Studio. See Configuring Anypoint Platform Credentials for more information.


## Test the Login Form Using the HTTP Connector Example
  1. Click the Open Exchange icon .
  2. Select **Provided by MuleSoft** in the pop-up Exchange window, filter per **Examples** , and look for the **Login Form Using the HTTP Connector**.
  3. Click **Open**. Studio imports the example as a new working project.
  4. If prompted, select **Perform Update** in **Update your Workspace**.
  5. Select the Manage Mule Projects APIs icon .
  6. Select **Modules** and update both **MUnit** and **Munit Tools** :
  7. Select **Apply and Close**.


### Test the Process for a Successful Login Attempt
  1. In your project, right-click `DoLoginFlow` and select **Munit** > **Record new test for this flow** :
The test recorder starts your project and starts recording the event going through that flow.
  2. Open a browser and navigate to `http://0.0.0.0:8081/login`.
  3. Type `mule` for both **Username** and **Password** , and click **Submit**.
The test recorder captures this event and stops the recording.
  4. Return to Studio and click **Configure Test** :
  5. Select the file name for the MUnit test suite in which you want to record your test.
  6. Under **Test name** , type `_DoLoginFlow-successfull_`.
  7. Set the test recorder to set the recorded input of the flow, and assert that the recorded output is the expected output by the test.
  8. In **Successful login** , select **Verify that this process was called** and set the counter **equal to** to time.
  9. Click **Next** and then **Finish**.
A fully functional MUnit test is generated to assert that the process in your application works as expected when the login is successful.


### Test the Process for an Unsuccessful Login Attempt
  1. In your project, right-click `DoLoginFlow` and select **Munit** > **Record new test for this flow** :
The test recorder starts your project and starts recording the event going through that flow.
  2. Open a browser and navigate to `http://0.0.0.0:8081/login`.
  3. Type `admin` in both **Username** and **Password** , and click **Submit** :
The test recorder captures this event and stops the recording.
  4. Return to Studio and click **Configure Test** :
  5. Select the file name for the MUnit test suite in which you want to record your test.
  6. Under **Test name** , type `_DoLoginFlow-unsuccessfull_`.
  7. Set the test recorder to set the recorded input of the flow, and assert that the recorded output is the expected output by the test.
  8. In the **Unsuccessful login** parse template step, select **Verify that this process was called** and set the counter to **equal to** time.
  9. Click **Next** and then **Finish**.
A fully functional MUnit test is generated to assert that the process in your application works as expected when the login fails.


## See Also
  * Test Recorder in Studio