【发布时间】:2019-05-23 15:56:41
【问题描述】:
我有如下的 groovy 代码:
def randomInt = RandomUtil.getRandomInt(1,200);
log.info randomInt
def chars = (("1".."9") + ("A".."Z") + ("a".."z")).join()
def randomString = RandomUtil.getRandomString(chars, randomInt) //works well with this code
log.info randomString
evaluate("log.info new Date()")
evaluate('RandomUtil.getRandomString(chars, randomInt)') //got error with this code
我想在 SoapUI 中使用 Groovy 评估一个类似于 {classname}.{methodname} 的字符串,就像上面一样,但是在这里出现错误,如何处理这个问题并让它像我期望的那样工作?
我已经试过了:
evaluate('RandomUtil.getRandomString(chars, randomInt)') //got error with this code
错误如下:
CST 2019 年 5 月 23 日星期四 22:26:30:错误:发生错误 [No such property: getRandomString(chars, randomInt) for class: com.hypers.test.apitest.util.RandomUtil],请参阅错误日志详情
【问题讨论】:
标签: groovy