# Test Result Export

{% embed url="<https://www.youtube.com/watch?v=4IwnJ0gqF4E>" %}

## <mark style="color:blue;">#export (Export to file)</mark>

Using #export you can create CSV or PDF files to create custom test reports tailored for your application.

### Process:&#x20;

1. <mark style="color:blue;">**Create a tab called REPORT within the test file and create your test report template**</mark>

<figure><img src="https://3835935664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F10lD1MSN8sl0KAFokfI3%2Fuploads%2FrjRBd5679DT6fnPmS6XO%2F2023-10-23_09h29_47.png?alt=media&#x26;token=92d48288-5478-41c9-bf64-aa603abff0b9" alt=""><figcaption></figcaption></figure>

2. <mark style="color:blue;">**To populate it with test results from each run refer to the test cells from the TEST tab**</mark>

<figure><img src="https://3835935664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F10lD1MSN8sl0KAFokfI3%2Fuploads%2FLMWHF9NcHeeeiuGVeQAk%2Fezgif.com-video-to-gif%20(6).gif?alt=media&#x26;token=5f92d929-b05a-4f50-a720-dc99f97f55e8" alt=""><figcaption></figcaption></figure>

\
3\. <mark style="color:blue;">**In your test sequence export the REPORT sheet as PDF or CSV**</mark>

PDF Example

*Export PDF from sheet "LABEL", range A1 to G30 to the file "Test\_Report.pdf", located in project's directory.*

<table data-full-width="true"><thead><tr><th width="141">Command<select><option value="69d37e59dbc44aaca6dc72161f84784b" label="#msg" color="blue"></option><option value="b928d283a7784fae8c94f7bc27467b23" label="#dlg" color="blue"></option><option value="dd3ea796575b44beb6fe421f4c920096" label="#goto" color="blue"></option><option value="1576fb8a623240f6a5cd19b0086ec379" label="#return" color="blue"></option><option value="5d7a98d7acab42ebae94f38253cd4252" label="#throw" color="blue"></option><option value="6c4f0bb0151b47dfba70bb09cbe953b1" label="#onerror" color="blue"></option><option value="4456763d3e2e4df9a8fe186c05a233d0" label="#onfail" color="blue"></option><option value="1fb65c562db94959b92fecd477c64baa" label="#catchio" color="blue"></option><option value="245770ec76da438ba7f63acf8dcd0c35" label="#oninput" color="blue"></option><option value="1e7166534c554904b78c14f6e2424e52" label="#export" color="blue"></option></select></th><th>Parameter</th></tr></thead><tbody><tr><td><span data-option="1e7166534c554904b78c14f6e2424e52">#export</span></td><td>pdf:sheet="REPORT":range=A1:to=G30:path="$project-dir$\Test_Report.pdf"</td></tr></tbody></table>

4. <mark style="color:blue;">**View PDF**</mark><br>

   <figure><img src="https://3835935664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F10lD1MSN8sl0KAFokfI3%2Fuploads%2FaphT1uMwWwKQtSLgHFaO%2Fimage.png?alt=media&#x26;token=ebe4c909-6e03-49a0-8b2e-7d7caec90a33" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The same process would follow for exporting to CSV file
{% endhint %}

## <mark style="color:blue;">#statrec (Basic statistics record)</mark>

This command is to create statistics record from each test execution and store it in one file location to enable test station monitoring.

Process

1. In the STAT tab define what values you want to save from each test run. In the first row define header and in the second row refer the results from the TEST tab (same process as creating test report above)<br>

   <figure><img src="https://3835935664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F10lD1MSN8sl0KAFokfI3%2Fuploads%2FowH9DVPMGfGwQkG7AqMh%2F2023-10-23_09h51_15.png?alt=media&#x26;token=39169b8d-cd4d-4881-afdd-d725f323696a" alt=""><figcaption></figcaption></figure>

2. In your test sequence use #statrect command to append current test result to a csv file\
   &#x20;

   **Example**

   Create a default (daily) statistic file in the project's "statfiles" sub-directory. The name will be "Dyyyy-MMdd< test-file>.csv", where "yyyy" is the year, "MM" month, "dd" day and "test-file" is the currently opened test-file. Every day a new-one will be created.

   <table data-full-width="true"><thead><tr><th width="141">Command<select><option value="69d37e59dbc44aaca6dc72161f84784b" label="#msg" color="blue"></option><option value="b928d283a7784fae8c94f7bc27467b23" label="#dlg" color="blue"></option><option value="dd3ea796575b44beb6fe421f4c920096" label="#goto" color="blue"></option><option value="1576fb8a623240f6a5cd19b0086ec379" label="#return" color="blue"></option><option value="5d7a98d7acab42ebae94f38253cd4252" label="#throw" color="blue"></option><option value="6c4f0bb0151b47dfba70bb09cbe953b1" label="#onerror" color="blue"></option><option value="4456763d3e2e4df9a8fe186c05a233d0" label="#onfail" color="blue"></option><option value="1fb65c562db94959b92fecd477c64baa" label="#catchio" color="blue"></option><option value="245770ec76da438ba7f63acf8dcd0c35" label="#oninput" color="blue"></option><option value="1e7166534c554904b78c14f6e2424e52" label="#export" color="blue"></option><option value="f6dfb045b1af49a68163d8801d5977f8" label="#statrec" color="blue"></option></select></th><th>Parameter</th></tr></thead><tbody><tr><td><span data-option="f6dfb045b1af49a68163d8801d5977f8">#statrec</span></td><td>&#x3C;none></td></tr></tbody></table>

3. View Result in CSV file and perform analysis<br>

   <br>

   <figure><img src="https://3835935664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F10lD1MSN8sl0KAFokfI3%2Fuploads%2F5kBkN9ZxtJj2zHyVtOWm%2F2023-10-23_10h01_23.png?alt=media&#x26;token=c12a459a-8477-4201-9df7-dc359b40c644" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">#AMSTAT (Automated Statistics)</mark>

**Coming Soon**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://funtest-1.gitbook.io/funtest-documentation/creating-test-sequence/funtest-commands/test-result-export.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
