Testing 如何在SoapUI中的Groovy脚本中定义返回类型为的方法?

Testing 如何在SoapUI中的Groovy脚本中定义返回类型为的方法?,testing,groovy,scripting,automation,soapui,Testing,Groovy,Scripting,Automation,Soapui,我需要一个应该向调用方返回字符串类型值的方法。为此,我编写了以下脚本 String getMethodValue = ReturnCountryName("US"); String ReturnCountryValue(String CName) { CName = "Mauritius"; return CName; } // Assign values to the global properties and call the servive com.eviware.s

我需要一个应该向调用方返回字符串类型值的方法。为此,我编写了以下脚本

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.")
我无法找到错误消息的解决方案,如下面的屏幕截图所示

我该如何克服脚本中的这个错误

谢谢,

Karunagara Pandi G

您声明了一个方法
ReturnCountryValue

String ReturnCountryValue(String CName) {
    CName = "Mauritius";
    return CName;
}
但是请调用
ReturnCountryName
。更改方法的名称或调用的名称