Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
You already know how much logs help in debugging. While working with virtual APIs in ReadyAPI, we are bound to get a ton of errors, and sometimes, our code might run just fine 😝. Logs maintain a record of everything that happens with our execution of test steps. ReadyAPI has a dedicated page to record logs of all the transactions that take place. In this blog, we will learn about the transaction log page and its features. ❄️❄️❄️❄️
Transaction Log Page
The virtual service editor contains the transaction log page. It is responsible for logging all the transactions taking place in real time. All the incoming requests and outgoing responses get recorded while the service runs. Below is the sample look of the same:
The page you see above contains all the records, everything that happens with the virtual API gets recorded. It includes information on all the requests that were sent to this virtual API, including those for which no response is designed.
To see the information about a request, click on the request, and a new dialogue box opens on the right. The requests body, headers, and other information are present here.
Successful and Failed Transactions
The transaction log page marks all the transactions as either failed or passed with red and green dots, respectively. You might notice from the image below that even if the response contains error codes; it passes because ReadyAPI considers a failure only if assertions are not fulfilled. ❄️❄️
Virtual services classify transactions as failed or successful based on the assertions. To find out what assertions failed:
✅Step 1: Click on the request, and a panel will get expanded on the right side.
✅Step 2: Click on the assertions and find the failed assertion. It will also mention the reason for failure.
Applying Filter
Filters are an excellent way to find a request based on keywords and phrases. The transaction log page has a text box dedicated to filters. You can filter out based on header details, timestamps, response codes, etc. The image below shows the location of the filter text box:
Log Capacity
Most of the time, we will only need the recent transactions. The log page, by default, displays only 25 current records. We can change it if needed, but keeping this number small is preferable. Small numbers of records will result in better performance and memory management. To change the log capacity, press the button and then change the "Transaction logs to keep" setting.
To erase log data manually, click on the button from the toolbar.
Number of Requests and Responses
To find the number of requests and responses, see the label on the log page, as shown in the image below.
Enable or Disable Logging
We can easily disable and enable logging on the fly with a button. Follow the images below to learn how to do it.
Let us now understand how we can enable logging once again.
Frequently Asked Questions
What are logs?
Logs are a way of recording process history. It helps keep track of all steps taken and allows for efficient debugging and error reporting.
What is a transaction?
A transaction in API testing is any request made to the server. Whether it passes or fails, it is considered a transaction. A transaction is done through a URL with a request body and headers being passed to it.
What is a Request?
A request is a message the client sends to the server asking for specific information or giving the server some data to save. The server is responsible for handling the request and reverting with a response.
Conclusion
In this blog, you learned about Transaction Log Page in ReadyAPI. All the important topics related to the Transaction Log Page in ReadyAPI were covered in detail.
Also, do refer to other API testing-related articles: