title: Where does Soap UI look for a file in new File() Groovy Script by default? How do i change this?
body: <p>I have a groovy script which reads the text from a file and returns it as a response</p>
  
  <p>i have to read it as follows</p>
  
  <pre><code>text = new File("D:/text.xml")
  </code></pre>
  
  <p>now the problem is i'd like to use relative paths.. so i was wondering</p>
  
  <p>If i just say</p>
  
  <pre><code>text = new File("text.xml")
  </code></pre>
  
  <p>Where does Soap UI / Groovy start searching for the file by default? This currently throws a "java.io.FileNotFoundException".</p>
  
  <p><em>How do i change this so that it uses paths relative to the project.xml file?</em></p>
  
  <p><strong>This is how i finally solved my requirement</strong></p>
  
  <pre><code>def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
  def projectPath = groovyUtils.projectPath //gets the path of the project root
  def response = new File(projectPath, "/test.xml").text;
  </code></pre>