To ensure your APIs can handle a high volume of visitors, you may use ReadyAPI to develop and execute load or performance tests. You can distribute load generation across a number of computers, including cloud machines, or conduct load tests locally. In this blog, we will see how to load page and transaction log in the performance tests in the ready API.
ReadyAPI gathers data while a test is running and shows it on the Load page.
On the Load Test Results tile on the Dashboard, you can also see the most recent outcomes of load test runs. You may always add this tile to your Dashboard if it doesn't already exist.
Load Page
Global Metrics for Test Case
Global measurements are gathered for each scenario and the full test case. A graph showing these metrics and pertinent test assertions is shown.
The metrics are by default shown throughout the full test scenario.
Metrics are shown as solid, multicolored lines. The horizontal scale displays the number of seconds since the test's beginning. Each metric has a separate vertical scale. To view a data point's value, time since the test began, and the minimum and maximum values of the associated statistics, hover your cursor over it.
Information regarding simulated virtual users and simulation outcomes are shown on the Transaction Log page. The Transaction Log table's rows each provide details about a request that a specific virtual user simulated. The information about the selected request is displayed in the Transaction Inspector on the right. The Log is initially empty. You must choose your logging preferences to enable logging.
To configure request logging, click the settings button. Configure conditions in the next dialog box.
The transaction log column contains many columns like Time Stamp, Test Stamp, Test Step Passed, trigger Timestamp, Time Taken, etc.
Details about test step
Step 1: Select the row in the table to get more information about the test step in the Transaction inspector on the right.
Step 2: Open the Request section or the Response section, as appropriate, to see the contents of the request or the response.
Step 3: Click Headers in the Request or Response area, respectively, to view the headers for either the request or the response.
Configuring Request Logging
By default, the freshly formed load test is not recorded in the log at all. We need to configure the logging conditions to log requests.
Logging Failed Transactions
Step 1: To capture failures, first go to the Log page and click Configure Transaction Log.
Step 2: You are prompted to choose whether you wish to store the log to a file in the box that appears. You can save the log to a file by selecting Yes. Choosing No will prevent you from saving the log to a file.
Step 1: Go to the Log page in the Performance Tests load test editor. To access the Logging Options dialogue, click Configure Transaction Log conditions.
Step 2: You can modify the circumstances for transaction logging in the Logging Options dialogue. Click the add button to add other conditions. Cross the conditions you want to remove.
Step 3: Choose the test target for which the requests will be logged from the Target drop-down list. Decide which value should be mentioned.
Step 4: Choose the logging conditions. Options include IF and NOT.
Step 5: Choose boundary values.
Step 6: Use the Log to drop-down list to choose where ReadyAPI will store the log data.
Step 7: Choose Log in distributed mode to record requests made by distant machines while conducting distributed testing.
Step 8: Click OK to save changes.
Script Filtering in Transaction Log
To filter the requests in the Performance Tests Transaction Log, use the condition script. The request results are shown if the script returns true. If not, the outcomes are ignored.
Available Properties
You may see and use the following properties in your scripts:
empty: Boolean, which returns true if the soapui_context is empty and false otherwise.
request: String. Plain text requests. identical to Request column
answer: string raw text in the reply identical to Response column
responseSize: number. The amount of data that was returned in bytes. similar to the Bytes column.
runningVUCount: Quantity. The total number of virtual users active at the time the chosen virtual user stopped operating. identical to the Currently Running column
status: Boolean. If the target test case ran successfully, true; otherwise, false. identical to the Status column.
statusCode: number. the HTTP status code returned. similar to the HTTP Status column.
Sample Scripts
Verify that the response contains the following text:
Application Programming Interface (API) is a set of functions and procedures that enables the development of applications that access the features or data of an application or operating system. API testing is the term for testing these functions.
Describe the primary distinction between API testing and UI level testing.
Testing a graphical interface is referred to as UI (User Interface). UI testing mostly concentrates on how an application looks and feels. On the other hand, API allows for communication between two different software systems.
Explain what is REST API.
It is a group of operations to which programmers can make requests and get answers. A REST API uses the HTTP protocol for communication. Representational State Transfer, or REST, is swiftly emerging as the de facto standard for developing APIs.
Conclusion
In this blog, we discussed the load page. We also discussed transaction logs and configuration request logging. In configuring request logging, we saw logging failed transactions and configuring transaction logs. In the end, we saw script filtering in the transaction log.