title: How to define a method with return type in Groovy script in SoapUI?
body: <p>I need a method that should return a string type value to the caller. For that, I have written the following script.</p>
  
  <pre><code>String  getMethodValue = ReturnCountryName("US");
  
  String ReturnCountryValue(String CName)
  {
      CName = "Mauritius";
      return CName;
  }
  
  // Assign values to the global properties and call the servive
  com.eviware.soapui.SoapUI.globalProperties.setPropertyValue( "CountryName", getMethodValue )
  
  // Call GetCitiesByCountry service to run
  def testStep = testRunner.testCase.testSteps['GetCitiesByCountry'];
  testStep.run(testRunner,context);
  
  // Message
  log.info("Testcase execution is completed successfully.")
  </code></pre>
  
  <p>I'm not able to find the solution for the error message as shown in the following screenshot.</p>
  
  <p><img src="https://i.stack.imgur.com/Em1Jm.jpg" alt="enter image description here"></p>
  
  <p>What shall I do to overcome this error in the script?</p>
  
  <p>Thanks, <br>
  Karunagara Pandi G</p>