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
Highlighted
Contributor

solved it use full package path include evaluate String: 

 

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

View solution in original post

3 REPLIES 3
Highlighted
Community Manager

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

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

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor
Highlighted
Contributor

solved it use full package path include evaluate String: 

 

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

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!