Auto Correlation
Correlation is the most important aspect of scripting. It generally includes fetching dynamic data from preceding requests/calls and posting it to the subsequent requests.
Let's take an example to find out why exactly we need correlation
Suppose we have recorded a scenario in which:
-
The user enters login details and click the OK button
-
The home page opens and the user take further actions
Now, if we just playback this script, the test will fail even for a single user. This is because of the authentication mechanism used. When we log in to a website, session variables are dynamically created. These session variables are passed to the subsequent requests and help validation and authentication of the actions performed. So, one cannot just record and playback the requests having these variables.
Here, we need to correlate the web requests with the dynamic variables. And for correlation, AIQ has the feature of Auto-correlation.
User Flow
-
Start creating the HAR functional scenario using the Scenario Builder, please refer to HTTP Proxy on how to create HAR scripts using Appvance HTTP Proxy.
-
Once created, Click play to run the scenario.
-
On the Controller page, Autocorrelation will be displayed as one of the options in the left navigation pane.
-
The user has to wait till the scenario execution is complete to work with Autocorrelation, else user will see a message telling "Please wait for the scenario execution to complete.
-
Once the scenario execution is Done, click Autocorrelation, Start Autocorrelation button will be enabled. If the tool is not able to generate any correlations, it will display a message telling, "no correlations were available for this scenario"
-
Click Start Autocorrelation, Depending on the number of correlations the tool generates, it might take some time to list all the correlations that are available
-
Once the autocorrelation tool identifies all the correlations, it will display the list of correlations as shown in the below screen-shot which shows Initial Request, Subsequent Request with Correlated Request with buttons to 'Accept All Autocorrelations', Accept individual Autocorrelation' and also user can 'Reject Autocorrelations'.
-
Users can click Accept All Autocorrelation to accept all the correlations, once clicked, it will display a message telling "All auto-correlations have been processed." with a 'Save Autocorrelated Scenario' button enabled.
-
Click Save Autocorrelated Scenario which will open the save dialog, User can create a new folder to save the autocorrelated scenario (scenarioname.autocorrelated.scenario) that saves along with the har script
-
Go back to Scenario Builder and open the autocorrelated scenario that was created using the autocorrelation tool
-
Go to the Store panel in the left navigation pane as shown in the screen-shot below, you will notice that all the correlations will be saved
-
Re-run the autocorrelated scenario to see the successful results