---
title: "Testing the export"
slug: "testing-the-export"
abstract: "Testing an audience export in Sitecore CDP before running it."
---
# Testing the export

We recommend that you test an audience export before running it. Testing involves previewing the export for a single guest. A successful test indicates that the output structure is correctly configured.

> [!note]
> A successful test doesn't guarantee that the export will be free of errors. That's because a test is based on a single guest, while the export is usually based on a large number of them.
>
> For example, if a data extension value is available for the test guest but not for some other guests in the export, the test will succeed but the export might contain errors.

## Selecting a guest for the test

When [testing an audience export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-2403bdd3-9298-c42f-b6b7-be1cb6ba9274 "Test an export"), you can select a random guest for the test by clicking **Test** > **Test scenario** on the audience export page or directly on the **Define output** screen. Then, in the search field, clicking **Visitor** or **Customer**.

Alternatively, you can select a guest from the specific segment used in the audience export by opening the segment. To do this, on the **Build** screen, in the **Audience** section, click the segment name. View the segment's [usage and details](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/introduction-to-batch-segmentation/view-segment-usage-and-details.html "View segment usage and details"), and from the **Usage** section, copy a guest reference. Then, return to the audience export and click **Test** > **Test scenario**  > **Guest reference**, and paste the copied reference into the search field.

For both methods, clicking **Test** will run the test for the specified guest.

## Test output

After the test finishes running, you can preview the exported data for the guest by clicking **Test** > **Response** > **Output**. The test output follows the output structure and file format you configured for the export.

If some data that you included in the output structure doesn't display in the test output, the data might not be available in the guest profile of the guest you chose for the test.

For example, maybe you added a string column in the output structure where the **Header** is *email* and the **Attribute value** is *${guest.email}*. If the guest profile used in the test doesn't contain the email address, the *email* column will not be included in the test output.

If the output displays errors, there might be problems with:

- The attribute values you entered in the output structure. See [Errors in the test output](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/troubleshooting-audience-export.html#UUID-330998c6-d2f8-3e33-1463-fa258ff06e18_section-idm4555369545448033895364484339 "Errors in the test output").
- The JavaScript you included in the audience export. See [Test log](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/testing-the-export.html#UUID-264293a8-6f5f-73bf-798f-3565cb114357_section-idm4668427964710433895282144368 "Test log") and [JavaScript in the export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/javascript-in-the-export.html "JavaScript in the export").

## Test log

In the JavaScript of an audience export, you can use `console.log()` to log messages to the test log.

After running the test, you can view the test log by clicking **Test** > **Response** > **Logs**.

We recommend that you use the test log when writing your JavaScript to make sure that the JavaScript computation is successful.