Forum Discussion

chris12345's avatar
chris12345
Visitor
3 years ago

Setting relative script library path

Hi,   we are working with multiple ReadyAPI projects, each using a different scripting library path. Team members have different locations where the projects are located. So we avoid absolute path...
  • TNeuschwanger's avatar
    3 years ago

    Hello chris12345 

     

    Maybe try a different syntax for setting the value...

     

    Instead of setting "Script Library" in project properties to

    ${=Paths.get(project.path).getParent().toString() + "\\Scripts"}

     

    How about setting "Script Library" in project properties to 

    ${projectDir}/Scripts/

     

    Regards,

    Todd

     

  • kitaitoa's avatar
    kitaitoa
    3 years ago

    Hi,

     

    I tried to set this property with the same value, but i's not functionaly in my project.

    did you (@chris12345 or TNeuschwanger) set another property ?

    I have this error: (my class is not found)

     

    Tue Aug 30 16:52:55 CEST 2022: ERROR: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    Script2.groovy: 1: unable to resolve class cxuRandomArbitrary
     @ line 1, column 1.
       import cxuRandomArbitrary; 
       ^
    org.codehaus.groovy.syntax.SyntaxException: unable to resolve class cxuRandomArbitrary
     @ 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:738)
    	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:901)
    	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627)
    	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:158)
    	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:149)
    	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:94)
    	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.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:302)
    	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:53)
    	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:192)
    	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1)
    	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:130)
    	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	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
    
       org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
       Script2.groovy: 1: unable to resolve class cxuRandomArbitrary
        @ line 1, column 1.
          import cxuRandomArbitrary; 
          ^

     

    thanks