作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要一个方法来返回一个字符串类型的值给调用者。为此,我编写了以下脚本。
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
。更改方法名称或调用名称。
关于testing - 如何在 SoapUI 的 Groovy 脚本中定义具有返回类型的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25376863/
我是一名优秀的程序员,十分优秀!