Monday, August 7, 2023

Export RAW analysis data to excel in Load runner | How to export RAW data to excel in LR Analysis

In the Analysis tool, exporting Raw Data to Excel might encounter limitations where not all rows are exported. This issue arises due to a well-known restriction within Microsoft Office Excel, which imposes a maximum row limit of 65,536 for .xls files. Additionally, specific settings within Analysis need adjustment to address this concern.

Dealing with Aggregation:
To address the issue of "Aggregated Data" replacing individual user IDs, it's important to understand Analysis' aggregation feature. Users have the option to disable aggregation to ensure results display relevant user IDs instead of the "Aggregated Data" label. Follow these steps:

1. Navigate to Menu -> Tools -> Options...
2. Select the "Result collection" tab.
3. In the "Data aggregation" section, choose "Automatically aggregate Web data only."
4. Reanalyze the results with these new settings to reflect the changes.

This adjustment allows all data to load with accurate user IDs, enhancing result clarity.

Handling Large Raw Data:
Given the substantial size of results, Analysis may not display them in full. Typically, only the first 100,000 records are shown, accompanied by a warning message. Users can expand this limit to accommodate larger datasets. Follow these steps:

1. Open the <LR>\bin\dat\GeneralSettings.txt file.
2. In the [general] section, add or edit the key: RawDataLimit=1700000.
3. Note that this modification increases the limit but demands more memory to construct the raw data.
4. After making these changes, reopen the Analysis results.

Optimal Export to Excel:
When exporting Raw Data to Excel, selecting the csv (Comma-Separated Values) format is recommended over the xls format due to the limitations of .xls files. Since Analysis doesn't yet support .xlsx files, opting for csv ensures compatibility. Once in the csv format, you can save the file using the available formats in Excel.

Saturday, July 29, 2023

correlation in Java Vuser Protocol

import lrapi.lr;

public class CorrelationExample {
public int init() throws Throwable {
// Perform initialization tasks
return 0;
}


public int action() throws Throwable {
// Send a request and receive the response
String response = sendRequest();

// Extract dynamic value using regular expressions
String dynamicValue = extractDynamicValue(response);

// Store the dynamic value in a parameter
lr.saveString(dynamicValue, "dynamicParam");

// Replace dynamic value with parameter in subsequent requests
String newRequest = replaceDynamicValueWithParam(response, "dynamicParam");

// Send the updated request
sendUpdatedRequest(newRequest);

return 0;
}

public String sendRequest() {
// Send the initial request and receive the response
String response = ""; // Replace with actual request code

return response;
}

public String extractDynamicValue(String response) {
// Use regular expressions or other methods to extract the dynamic value
String dynamicValue = ""; // Replace with actual extraction code

return dynamicValue;
}

public String replaceDynamicValueWithParam(String request, String paramName) {
// Replace the dynamic value in the request with the parameter
String newRequest = request.replaceAll("{{dynamicValue}}", lr.evalString(paramName));
return newRequest;
}

public void sendUpdatedRequest(String request) {
// Send the updated request
// Replace with actual code to send the request
}

public int end() throws Throwable {
// Perform cleanup tasks
return 0;
}
}