Ask a Question

How to evaluate a String which one like a classname.methodname in SoapUI with Groovy?

SOLVED
白夜有点黑
Contributor

How to evaluate a String which one like a classname.methodname in SoapUI with Groovy?

I have groovy code as below: 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 I want to evaluate a String which one like a classname.methodname in SoapUI with Groovy, just like above, but got error here, how to handle this and make it works well as I expect?
3 REPLIES 3
TanyaYatskovska
SmartBear Alumni (Retired)

@HimanshuTayal@nmrao@groovyguy, could you please share your thoughts regarding this error?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



solved it use full package path include evaluate String: 

 

evaluate("com.test.apitest.util.RandomUtil.getRandomString(chars, randomInt)")

cancel
Showing results for 
Search instead for 
Did you mean: