Write to .txt file?


#1

Running my script it measures the time some actions took.

I am looking for a way to save these times in a .txt file instead of using comment() or println(), to make it easier to see which steps might have too long loading times.

My first soltution was using Printstream, but it does not work if I test on the Kobiton cloud.

Thank you for any advice.


#2

I think you could use the following solution to write log file:

import com.kms.katalon.core.logging.KeywordLogger
KeywordLogger log = new KeywordLogger()
log.logInfo(text);

#3

Could you please help me with , how to copy the API response to an external text file?


#4

Raghu Chukkala,

i use java.io.File class methods (Works with csv,txt,excel)

here is my example:

import java.io.File

f = new File(“C://Users/User/Desktop/Log.txt”)

def valueA = “testA”

f.append(valueA+ " hello")


#5

I believe timestamps/timings for steps are captured in the execution.log. It’s quite verbose, but the information should be in there


#6

This was very helpful for me, great short and to the point example!