Forum Discussion
avidCoder
8 years agoSuper Contributor
You can handle this using File in java. Go through this code:-
//Use File Counter to increase file count and set it at testCase level:-
fileCtr = Integer.parseInt(fileCtr) + 1
testRunner.testCase.setPropertyValue("fileCtr",String.valueOf(fileCtr))
//It will read the file in String
File resFolder = new File(path_of_folder_where_files_resides)
File[] listOfFiles = resFolder.listFiles();
File fOut = listOfFiles[Integer.parseInt(fileCtr)];
String res = FileUtils.readFileToString(fOut)
log.info res
Hope, it helps you out.