Unable to read from file after 1 test run, org.apache.poi.EmptyFileException: The supplied file was empty (zero bytes long) Unable to read from file after 1 test run, org.apache.poi.EmptyFileException: The supplied file was empty (zero bytes long) selenium selenium

Unable to read from file after 1 test run, org.apache.poi.EmptyFileException: The supplied file was empty (zero bytes long)


The problem is in FileOutputStream fos = new FileOutputStream(src);, it creates new file without content. Since src is the input file as well its now empty.

Either don't use it (I couldn't find any uses), write to another file or use FileOutputStream fos = new FileOutputStream(src, true); if you want to append data to the file.