title: How to specify working directory for groovy scripts in soap ui?
body: <p>Currently all groovy scripts i run in soap UI seems to be using "...\SoapUI-5.2.1\bin" as the working directory. From one of the answers to <a href="https://stackoverflow.com/questions/14039514/where-does-soap-ui-look-for-a-file-in-new-file-groovy-script-by-default-how-d">this question</a> I tried setting the Resource Root property of my project, however this has no effect on the working directory that the groovy scripts use.</p>
  
  <h1>Example</h1>
  
  <p>Create a new project in SoapUI. Add a testsuite, testcase and a groovy script test step. In the test script simply put:</p>
  
  <pre><code>log.info new File("").getAbsolutePath()
  </code></pre>
  
  <p>Click on the green arrow to run the script. For me this will always return a path to the bin folder of the SoapUI installation.</p>
  
  <h1>What I'm looking for</h1>
  
  <p>In tools like for example IntelliJ it's possible to specify a working directory in the run configurations for a script. This allows the tool to start the process from any path. In addition to this most other tools will default the working directory to the project folder and not the tools installation folder like SoapUI seems to do.</p>
  
  <h1>My current workaround</h1>
  
  <p>I'm currently using a working directory variable that I pass to all relevant path strings in my scripts. Using the example above this would look like:</p>
  
  <pre><code>String workingDir = "C:/somedir/"
  log.info new File(workingDir  + "somepath").getAbsolutePath()
  </code></pre>
  
  <p>While this works it's not as elegant as what I can do with other tools like mentioned above.</p>