For a test to run correctly, a request that is sent to a server might need to use a value that was returned by a previous request. By ensuring that this data is correlated accurately, you can produce better performance tests.
Before you go ahead with the approach of correlating data in RPT, let's understand what does data correlation mean ??
Interactions with an application are typically related to each other. For example, consider the following interactions with a web-based application, in which each request depends on information returned from a previous response:
A payroll clerk types the web address for an application, which sends a login prompt. When the clerk logs in, the web server returns a page that indicates that login has succeeded and a unique session ID to the web browser that the clerk is using.
The clerk clicks a link on the returned page, which requests that the web server open the page for searching the employee database. The web browser includes the session ID when sending the request. Based on the session ID, the web server knows that the request comes from someone who is already logged on, and so opens the search form for the employee database. The clerk then searches for a specific employee. The web server returns a photograph of that employee and the employee's unique ID.
The clerk clicks a link that requests the web server to return the payroll record for the employee. With this request, the web browser sends two IDs:
The session ID, so that the web server knows that the request comes from some who is logged on
The employee ID, so that the web server can locate and return the correct information
In this example, request 2 depends on request 1, and request 3 depends on requests 1 and 2.
If you record these interactions in a test, before running the test with multiple users, you would vary the test data. For example, you would replace the user name and password values, the employee name search values, or both, with values that datapools contain. When you run the test, each virtual user returns a different employee payroll record, based on the contents of the datapools.
In a generated test, where data in a request depends on data that is contained in the response to a previous request, the request data is substituted from the response data on which it depends. The term for this internal linking of response and request data is data correlation. When you run a test with multiple users and varied data, data correlation is required to ensure that the test runs correctly.
The above scenario is just an example explaining the concept of data correlation. So what sort of approach would you take in case of SAP application testing. Let's look at another example here.
Say, you have captured some document number from SAP GUI screen and would like to pass that in next multiple transaction as shown in below screenshots.
For the above mentioned use case you will have to create a "Get" on that element (Vendor Number in this case)
1) Locate the element in the screen-shot (which is Vendor Number)
2) Right-click on it and say Create Element
NOTE: Use SAP Get as mentioned above. A new element gets added as shown below.
3) Now, highlight the value required and right-click and say "Create Reference"
4) You will get a reference that you can substitute the required values with.