Forum Discussion

normgean's avatar
normgean
New Contributor
3 years ago

groovy script errors

running on

MacBook Pro (M1) using Ventura 13.1

Soap UI 5.7.0

JDK version - openjdk version "19.0.1" 2022-10-18

 

Cannot get any groovy script to work, even a basic on as just this

log.info ”soapUI script”

 

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script13.groovy: 1: Unexpected input: '”' @ line 1, column 10. log.info ”soapUI script” ^ org.codehaus.groovy.syntax.SyntaxException: Unexpected input: '”' @ line 1, column 10. at org.apache.groovy.parser.antlr4.AstBuilder$1.syntaxError(AstBuilder.java:4597) at groovyjarjarantlr4.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:44) at groovyjarjarantlr4.v4.runtime.Parser.notifyErrorListeners(Parser.java:543) at groovyjarjarantlr4.v4.runtime.DefaultErrorStrategy.notifyErrorListeners(DefaultErrorStrategy.java:154) at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.reportInputMismatch(DescriptiveErrorStrategy.java:103) at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.recover(DescriptiveErrorStrategy.java:55) at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.recoverInline(DescriptiveErrorStrategy.java:68) at groovyjarjarantlr4.v4.runtime.Parser.match(Parser.java:213) at org.apache.groovy.parser.antlr4.GroovyParser.compilationUnit(GroovyParser.java:362) at org.apache.groovy.parser.antlr4.AstBuilder.buildCST(AstBuilder.java:405) at org.apache.groovy.parser.antlr4.AstBuilder.buildCST(AstBuilder.java:384) at org.apache.groovy.parser.antlr4.AstBuilder.buildAST(AstBuilder.java:424) at org.apache.groovy.parser.antlr4.Antlr4ParserPlugin.buildAST(Antlr4ParserPlugin.java:58) at org.codehaus.groovy.control.SourceUnit.buildAST(SourceUnit.java:257) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) at org.codehaus.groovy.control.CompilationUnit.buildASTs(CompilationUnit.java:666) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:632) 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.compile(SoapUIGroovyScriptEngine.java:136) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:87) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:143) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:251) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) 1 error 

  • Hello normgean 

     

    Are you copy/pasting that line from the internet or something into a groovy script test step?  I copied and pasted your example into a script and it failed for me too.  If I actually type that line in and run the script, I get an expected result of a log line being displayed. 

     

    If you are actually typing that value into a script, could you have changed fonts or something other than the default provided by SoapUI?  The double quote characters look a little odd to me on a Windows computer and that makes me wonder if there is some alternate character set involved and that is not an actual ASCII double quote.

     

    When I type it in myself and view the hexadecimal representation of what I typed in a separate code editor I get what I expect...   HEX 22 = double quotes character.  Your example for the " character yields a HEX 94 = right double quotation mark.  Maybe SoapUI does not interpret that correctly or it only expects HEX 22 variant of a double quotes character instead of HEX 94.

     

    Regards,

    Todd

  • TNeuschwanger's avatar
    TNeuschwanger
    Champion Level 1

    Hello normgean 

     

    Are you copy/pasting that line from the internet or something into a groovy script test step?  I copied and pasted your example into a script and it failed for me too.  If I actually type that line in and run the script, I get an expected result of a log line being displayed. 

     

    If you are actually typing that value into a script, could you have changed fonts or something other than the default provided by SoapUI?  The double quote characters look a little odd to me on a Windows computer and that makes me wonder if there is some alternate character set involved and that is not an actual ASCII double quote.

     

    When I type it in myself and view the hexadecimal representation of what I typed in a separate code editor I get what I expect...   HEX 22 = double quotes character.  Your example for the " character yields a HEX 94 = right double quotation mark.  Maybe SoapUI does not interpret that correctly or it only expects HEX 22 variant of a double quotes character instead of HEX 94.

     

    Regards,

    Todd

  • normgean's avatar
    normgean
    New Contributor

    yes it was a copy & paste issue, thanks for pointing this out and was pretty obvious