Skip to main content

Create, Run, and Map a Custom Test

Updated this week

After setting up a Custom Connection and submitting data, you can create custom tests to validate that data and link it to your controls. This guide walks you through the full lifecycle: building a test, reviewing results, managing exceptions, and mapping to controls.

Create a Custom Test

  1. Go to the Monitoring tab.
    This is where all custom tests associated with your Custom Connections are displayed.

  2. Select Create test.

  3. Enter a name and description for your test. Choose something clear and descriptive, especially if you plan to run multiple tests against the same data source.

  4. In the Test Builder, configure your logic:

    • Category: Select Custom

    • Provider: Enter the name of your custom connection

    • Condition Group: Choose the resource (your data source) and define attributes for the test (e.g., hasMFA = true)

    💡 If your dataset includes complex nested arrays, you may need to use the Advanced Editor to write custom test logic.

  5. Save the test.
    It will be saved as a draft until you’re ready to publish.

Run or Publish the Test

You can run a draft test at any time to preview its behavior.

  1. Go to the Monitoring page (or the Monitoring tab of your specific Custom Connection).

  2. Use filters to find your test:

    • Custom (Draft) – tests not yet published

    • Custom (Published) – tests actively monitored

  3. Select your draft test and run it manually to view the results.

  4. When ready, publish and run the test to include it in monitoring and evidence collection.

Learn more about Drata's Monitoring or Custom Tests.

View and Mange the test results

  1. On the Monitoring page, select the desired custom tests.

  2. Under the Last test result, select View event to verify event tracking details and raw evidence.

  3. To exclude a record from future tests.

    • Select the record.

    • Choose the Exclude option.

To learn more about exclusions, go to Exclusions.

Link Tests to Controls

You can map a custom test to your controls.

  1. In the test drawer, scroll to the Control info section.

  2. Select Map controls to link the test to one or more controls.

To learn more, go to Mapping Tests and Controls.

Did this answer your question?