title: How to write a recursive function in groovy which wait for a particular value in response | SOAP UI
body: <p>I have a GET request which is looking for value <code>complete</code> in response but this value can be <code>processing</code> or <code>request_is_in_process</code> if the process in server is not complete.</p>
  
  <p>Now I need a groovy script or trick in soap-ui which can keep processing this request until it do not find value as <code>complete</code> in response.</p>
  
  <p>For more clarification I have created a separate project for this request and it is going to save my value in global properties.</p>
  
  <pre><code>import groovy.json.JsonSlurper
  
  responseContent = testRunner.testCase.getTestStepByName("Checking_Request").getPropertyValue("response")
  slurperresponse = new JsonSlurper().parseText(responseContent)
  log.info (slurperresponse.products.status)
  
  
  
  def valueFromPreviousResponse = slurperresponse.products.status
  context.testCase.testSuite.setPropertyValue('Status_of_Product_import_request', valueFromPreviousResponse)
  
  com.eviware.soapui.SoapUI.globalProperties.setPropertyValue( "Status_of_Product_import_request", valueFromPreviousResponse )
  </code></pre>
  
  <p>Above code is setting up my value awesomely fine. Just I need to keep running that teststep until it do not find the value as <code>complete</code></p>
  
  <p>Note:- I am testing on REST API. Everything is in JSON format. Another thing is I am using free version of SOAP-UI, not an pro version</p>
  
  <p>I am new in SOAP-UI and for groovy as well. so any suggestion will be helpful/welcome.</p>
  
  <p>Thanks in advance!! :)</p>