Monday 8 April 2024

Export the comments for the transaction controller in JMeter to a CSV file

You can export the comments by following these steps:

1. Add a "Simple Data Writer" listener to your test plan. Right-click on the "Thread Group" or any other element in your test plan, then go to Add -> Listener -> Simple Data Writer.

2. Configure the "Simple Data Writer" listener to save the data in CSV format. In the listener settings, specify the filename with a .csv extension (e.g., comments.csv).

3. In the "Write results to file" section of the "Simple Data Writer" listener, select the checkboxes for the data you want to save. To include comments, make sure to check the box next to "Save comments."

4. Run your test plan. Once the test execution is complete, the comments along with other data will be saved to the specified CSV file.

5. Open the CSV file using a text editor or spreadsheet application to view the comments.

This method allows you to export comments along with other data captured during the test execution.

Method 2:

If you don't find the "Save comments" option is in the "Simple Data Writer" listener directly. Instead, you can achieve this by adding a Beanshell PostProcessor to the Transaction Controller.

Here's how you can do it:

1. Add a "Transaction Controller" to your test plan.

2. Inside the Transaction Controller, add the elements you want to measure.

3. Add a "Beanshell PostProcessor" as a child of the Transaction Controller.

4. In the Beanshell PostProcessor, you can use the following script to save the comments to a CSV file:

```java
import java.io.FileWriter;
import java.io.PrintWriter;

String comment = prev.getSampleLabel();

try {
    FileWriter fileWriter = new FileWriter("comments.csv", true);
    PrintWriter printWriter = new PrintWriter(fileWriter);
    printWriter.println(comment);
    printWriter.close();
} catch (Exception e) {
    log.error("Error while writing to file: " + e.toString());
}
```

Replace "comments.csv" with the desired filename for your CSV file.

5. Run your test plan. After execution, the comments will be saved to the specified CSV file.

This script extracts the sample label (comment) of the transaction and appends it to a CSV file.

Wednesday 27 March 2024

Integrating Tosca with Neoload - Step-by-Step Guide

1. Install Tosca and Neoload: Ensure you have both Tosca and Neoload installed on your machine. You can download and install both applications from their respective websites or through your organization's software distribution channels.

2. Configure Tosca:
    - Open Tosca and navigate to `ExecutionLists`. This is where you manage your test execution configurations.
    - Create a new ExecutionList or open an existing one where you want to integrate Neoload.
    - Add the test cases you want to execute with Neoload to this ExecutionList.

3. Install Neoload Integration Pack:
    - Download the Neoload Integration Pack from the Tricentis website. This pack provides the necessary components to integrate Tosca with Neoload.
    - Follow the installation instructions provided with the Integration Pack to install it on your machine.

4. Configure Neoload Integration in Tosca:
    - In Tosca, navigate to `Settings > Options > Execution > Neoload`. This is where you configure the Neoload integration settings.
    - Provide the path to the Neoload executable. This allows Tosca to invoke Neoload during test execution.
    - Configure Neoload settings such as the project name, scenario name, and runtime parameters. These settings determine how Neoload executes the load test.

5. Configure Neoload Integration in Neoload:
    - Open Neoload and navigate to `Preferences > Projects`. This is where you configure Neoload's integration settings with external tools like Tosca.
    - Enable the Tosca integration and provide the path to the Tosca executable. This allows Neoload to communicate with Tosca during test execution.

6. Define Neoload Integration in Tosca ExecutionList:
    - In your Tosca ExecutionList, select the Neoload integration as the execution type. This tells Tosca to use Neoload for load testing.
    - Configure Neoload-specific settings such as the test duration, load policy, and other parameters relevant to your performance testing requirements.

7. Run the Tosca ExecutionList with Neoload Integration:
    - Execute the Tosca ExecutionList as you normally would. Tosca will now trigger Neoload to execute the load test based on the defined settings.
    - During execution, Tosca will communicate with Neoload to start and monitor the load test.

8. Analyze Results:
    - Once the load test execution is complete, analyze the results in both Tosca and Neoload.
    - Use Tosca to review functional test results and Neoload to analyze performance metrics such as response times, throughput, and server resource utilization.
    - Identify any performance issues or bottlenecks and take appropriate actions to address them.

By following these steps, you can effectively integrate Tosca with Neoload to perform combined functional and performance testing.