# How Auto Correlation Works in AIQ

## Basic Example

Let’s there be a Alpha request/response Pair such that

<div class="codeSnippet" id="bkmrk-copy-request%28alpha%29-">[Copy](javascript:void(0);)<div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False">```
request(Alpha) = http://server/getProducts<br></br>response(Alpha) = [{productId=512,productName=“Screw”, price= “5”},<br></br>{productId=631,productName=“Hammer”, price= “10.4”} ]
```

 </div> </div>And let Beta be a request/response Pair such that

<div class="codeSnippet" id="bkmrk-copy-request%28beta%29-%3D">[Copy](javascript:void(0);)<div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False">```
request(Beta) = http://server/purchaseProduct?id=512<br></br>response(Beta) = …
```

 </div> </div>A correlation could be seen here in the productId from the request of Alpha which is used in the response of Beta. Highlighting the correlation.

<div class="codeSnippet" id="bkmrk-copy-response%28a%29-%3D-%5B">[Copy](javascript:void(0);)<div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False">```
response(A) = [{productId=512,productName=“Screw”, price= “5”},<br></br>{productId=631,productName=“Hammer”, price= “10.4”} ]<br></br>request(B) = http://server/purchaseProduct?id=512
```

 </div> </div>## Supported Formats 

- HTML
- XML
- JSON
- CSV
 
## Features and Best Practices 

- When working with autocorrelation, Always check to Execute all HAR calls (even after a failure) in the Options panel of Scenario Builder under HAR Script Options.
- Never check 'Mark each request as a step' (it will make autocorrelation fail sometimes).
- Autocorrelation rejects unnecessary correlations.
- Autocorrelation makes har scripts Less brittle.
- Autocorrelation cleans duplicated correlations.
- A1 -- &gt; B
    
    A2 -- &gt; C
    
    A1 == A2
    
    Automatically transform A2 to A1 (Shrinks memory footprint)
    
    A1 -- &gt; B
    
    A1 -- &gt; C
- 'Show headers, requests, and responses in each test case execution output' option is useful for the Development team to debug, similar to the designer script debug option. Please mark this option if (and only if) you want the development team to review autocorrelation.
- Autocorrelation supports URLs with or without port, the below 2 URLs are handled the same way.
    
    
    - https://appvance.ci.cloudbees.com/login.html
    - https://appvance.ci.cloudbees.com:443/login.html
 
<div id="bkmrk-last-updated%3A-august">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">August 09, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>