Do we have any mechanism to verify the application generated log when we running the API automation?

  1. We were written the API automation testing use the Rest Assured using Java language.
  2. When we ran the automation it will fire the request and verify the expected response against actual response .
  3. But out application generate the trans log as below for each API request

Date time | Status | Name |Mobile Number |Status Description

How can we verify above trans log with our automation script ?

1 Like

you want your product team to give you a secure entry point API that lets you access the back end logs, or a way to connect to the logging database directly. both will require you write a filter so that you only get log messages that are relevant to the session under test. Regardless, you want the event on the back end as it actually arrives for final processing, not before.

Mostly it’s easier to just hack a back door into the database for the test environment, however that may mean that your test will break every time the database schema updates in any fashion that impacts the logging stored procedure. So my suggestion is to ask for some help to make the product easier to test, and to add a new web-service that is fully secured as well as hidden from the web to make it possible for a test to use logs or events and filter efficiently. Logs are super useful for other reasons as well, which will get more apparent the more you use logs for testing. Good luck.

Do mean application log verification will be manual process for on a testing . Can’t do that via automation.

no you want a web service entry point that lets you query the log - the developers of the app must give this to you. Without it their app/system is untestable, so it will make testing the app harder to do and slow down the software lifecycle if the app is hard to test end-to-end.