Forum Discussion

kadir's avatar
kadir
Occasional Contributor
9 months ago

readyapi can't find custom groovy script

I added my custom groovy script Utilities.groovy file to C:\Program Files\SmartBear\ReadyAPI-3.49.0\bin\scripts but when I add following to groovy script step it is giving error;

import Utilities

error: 

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

Script8.groovy: 1: unable to resolve class Utilities

 @ line 1, column 1.

   import Utilities

   ^

org.codehaus.groovy.syntax.SyntaxException: unable to resolve class Utilities

 @ line 1, column 1.

at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:262)

at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1434)

at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:262)

at org.codehaus.groovy.control.CompilationUnit.lambda$new$16(CompilationUnit.java:739)

at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:902)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:628)

at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389)

at groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332)

at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)

at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)

at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330)

at groovy.lang.GroovyShell.parseClass(GroovyShell.java:526)

at groovy.lang.GroovyShell.parse(GroovyShell.java:538)

at groovy.lang.GroovyShell.parse(GroovyShell.java:570)

at groovy.lang.GroovyShell.parse(GroovyShell.java:565)

at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.recompileWithNewName(SoapUIGroovyScriptEngine.java:167)

at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:155)

at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)

at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:98)

at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:159)

at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:344)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

at java.base/java.lang.Thread.run(Thread.java:833)

 

1 error

 

See Error Log for details.

 

the followings groovy jars I have in C:\Program Files\SmartBear\ReadyAPI-3.49.0\lib

not sure what is missing? thanks in advance

 

  • kadir 

    Please have a look at the documentation for the same so that you will have an idea what is wrong.

    Please show your Utilities.groovy file for review if you still having issue after going thru documentation.

  • nmrao's avatar
    nmrao
    Champion Level 3

    kadir 

    Please have a look at the documentation for the same so that you will have an idea what is wrong.

    Please show your Utilities.groovy file for review if you still having issue after going thru documentation.

  • kadir's avatar
    kadir
    Occasional Contributor

    thanks, the documentation link you shared solved the problem, Preferences > ReadyAPI was pointing to different version and I didn't have that version so it was not finding that file.