private File createFile ( ITestResult tr , File parentFolder ) { String path ; if ( tr != null ) { // tr is null only on tests purpose path = String . format ( "%s%c%s.png" , parentFolder . getAbsolutePath ( ) , File . separatorChar , tr . getName ( ) , getDateSuffix ( ) ) ; } else { path = String . format ( "%s%ctest_%d.png" , parentFolder . getAbsolutePath ( ) , File . separatorChar , System . currentTimeMillis ( ) ) ; } return new File ( path ) ; }
Generate the file to save the screenshot taken .