Question

Is there a way to give specific names to the API logs in Tosca?

  • 2 February 2024
  • 2 replies
  • 19 views

Badge

Hello,

 

As mentioned in the title, is there a way to give a specific name (e.g. the name of the request / response) to the API logs that are logged by Tosca?

 

Thanks in advance!


2 replies

As I mentioned here: https://shiftsync.tricentis.com/product-forum-50/api-request-response-attributes-in-tosca-reports-652?postid=2115#post2115 my understanding is, that the only way to achieve this is to use the save-modules:

if you want to define a path, where Request/Response should be saved, you can use »save Json/XML resource« by using  LastRequestResource and LastResponseResource as resource identifiers → see https://support-hub.tricentis.com/open?id=kb_article_view&sysparm_article=KB0015009 Method 3. Disadvantage is of course, that you would have to use the teststeps every single time, you have an request / response.

 

Regards.

Userlevel 2
Badge

As I mentioned here: https://shiftsync.tricentis.com/product-forum-50/api-request-response-attributes-in-tosca-reports-652?postid=2115#post2115 my understanding is, that the only way to achieve this is to use the save-modules:

if you want to define a path, where Request/Response should be saved, you can use »save Json/XML resource« by using  LastRequestResource and LastResponseResource as resource identifiers → see https://support-hub.tricentis.com/open?id=kb_article_view&sysparm_article=KB0015009 Method 3. Disadvantage is of course, that you would have to use the teststeps every single time, you have an request / response.

 

Regards.

This method will only save the request and response bodies, right? Not the header, endpoint etc which you also get with Method 2.

Depending on what you’re using the logging information for, this may be better or worse. I prefer Method 2 especially since it only needs to be configured once and gives you full information for debugging, but there are times where just having the message body might be tidier (e.g. if you wanted to resend the exact request, or attach request/responses to a defect as evidence).

Actually this reminds me, another similar solution I’ve used in the past (probably in conjunction with the Method 2 full logging) is to buffer the LastRequestResource and/or LastResponseResource, so that the full messages are available in the execution logs directly - no need to open another file.

Reply