ZAPTEST - API Correlation Manager Overview In this video we will learn how to use API Correlation Manager. API Correlation manager helps to correlate output parameters of previous steps into input parameters of next executing steps. As an example, when we login to the web application, we usually get a unique key identifier. And we are supposed to provide this key every time when we send a request to the server. During the recording we recorded the key. But in a re al execution this key is dynamic. Using the correlation manager we can easily apply rules to correlate such parameters. To open API Correlation Manager please, find the API Correlation icon on the toolbar or use the main navigation menu: TOOLS -> API Correlation Manager. Let’s overview the main interface. There are 2 main parts: the correlation rules at the top, and correlation results at the bottom. Also we could search for values between all requests using the search box. We will try to search for the “Set-Cookie” header. Type it into the search field and click the search button. We can see search results at the bottom. The “Highlight Next” button highlights the next results in the request or response textbox. Let’s add a new rule. Each rule contains “name”, “input” and “output” parameters. Input parameters are rules which extract data from the API response. Output Parameters show us how we use extracted data in the API requests. There are 3 types of detectors of input correlation value: First is the “By Header” type: ZAPTEST takes a header value as a value to replace in the request. This type has 2 parameters: header name and regular expression if we need to customize the parameter. The next type is “By Suffix and Prefix”. In this case ZAPTEST operates with a value, which is placed between two text parts: left and right. The last is “By Regular Expression” type; This is a most general type which uses regular expression for getting a value. We will use the “By Header” type with the header name “Set-Cookie”. Click Show results button to see if this correlation catches some input and output values. As we can see, there are only input values. This means we should adopt our output value and remove the path parameter. To do so we should “add regular expression.” Click the search button again. Now we can see that this rule catches some recorded items. As for Output correlation parameters there are four types: First is the ”Replace by value” type. This type simply replaces an old value with a new one. This is the most common type of output parameter. Next is the “Replace by Suffix and Prefix” and “Replace By regular Expression” types. They replace a value by searching value in request data. The parameters are identical to the corresponding parameters for input correlation types. Lastly there is the “Remove Header”\ type, which simply removes the entered header from request data, when the input correlation parameter matches the value. Right now, we will use the “Replace By value” type. When our first correlation is ready. We should regenerate the code. To do it, go to the main menu, select “CODE”, and then select “Re-Apply correlation rules”. Click yes. Then, Close API Correlation Manager. We can see that ZAPTEST generates correlation rules before calling steps. If we need to update correlation rules we can open API Correlation Manager, “Updates”, or add new rules and regenerate this code as well by selecting the “Re-Apply correlation rules” menu item in the API Correlation Manager dialog. Thank you for using ZAPTEST.