Forum Discussion
tinoboehme
11 years agoOccasional Contributor
Hello,
yes, the script library is set correctly and the package struckture is also okay. Following code is running fine:
I've the same problem with eval:
The interesting thing is following code is working find in a "Groovy Script TestStep" but NOT inside a method of me Library. Why????
I figured out that the evaluate() method is inside the groovy.lang.GroovyShell Class, but I couldn't find any way to use
If I try to create a new object (constructor is present) with the last solution (string = "new soapui.utils.MyUtils()") I get follwing Exception:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 1: unable to resolve class soapui.utils.MyUtils
I've send many days in this topic! I really have no more Idea.
Please Help!!!
yes, the script library is set correctly and the package struckture is also okay. Following code is running fine:
result = soapui.utils.MyUtils.randInt(10,20)
log.info(result)
I've the same problem with eval:
string = "soapui.utils.MyUtils.randInt(10,20)"
result = Eval.me(string) // groovy.lang.MissingPropertyException: No such property soapui for class: Script1
The interesting thing is following code is working find in a "Groovy Script TestStep" but NOT inside a method of me Library. Why????
string = "soapui.utils.MyUtils.randInt(10,20)"
result = evaluate(string)
I figured out that the evaluate() method is inside the groovy.lang.GroovyShell Class, but I couldn't find any way to use
def shell= new groovy.lang.GroovyShell()
result = shell.evaluate(string) // groovy.lang.MissingPropertyException: No such property soapui for class: Script1
If I try to create a new object (constructor is present) with the last solution (string = "new soapui.utils.MyUtils()") I get follwing Exception:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 1: unable to resolve class soapui.utils.MyUtils
I've send many days in this topic! I really have no more Idea.
Please Help!!!
Related Content
- 5 years agoComputingFroggy
- 13 years agogordillo_ramon