title: How to check file exists in Groovy script
body: <pre><code>Workbook aWorkBook = Workbook.getWorkbook(new File(&quot;C:\\Users\\Response.xls&quot;));     
  WritableWorkbook workbook1 = Workbook.createWorkbook(new File(&quot;C:\\Users\\Responses.xls&quot;), aWorkBook);
  </code></pre>
  <p>I am doing DATA DRIVEN TESTING using Groovy script in SOAP UI. Above is the part of the code where it is creating new file and then writing PASS or FAIL result to that excel. Suppose if have 5 testcases then I want to create new file only once in the first loop(1st testcase) then for next loop its should open the existing file.But currently it is creating new file in every loop and overriding the data and PASS result is displaying only for the last testcase. Can anyone help to resolve this?</p>