cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
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?
1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

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

solved it use full package path include evaluate String: 

 

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

3 REPLIES 3
Community Manager

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

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

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

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

Contributor

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

solved it use full package path include evaluate String: 

 

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

New Here?
Join us and watch the welcome video:
SmartBear + Cucumber
Top Kudoed Authors