Contributions
Re: Unexpected token in Groovy Scripting.
HiJHunt, still getting the same error. Code in Java: package com.raaki.demo; public class HelloWorld { public void greeting(String name) { System.out.println("Hi "+name+ " How are you !?"); } } Code in SoapUI: import com.raaki.demo.HelloWorld; class Raaki{ def context; def static log; def testRunner; def Raaki(log,context,testRunner){ this.log=log; this.context=context; this.testRunner=testRunner; } static void main(String[] args){ def obj=new HelloWorld(); def str=obj.greeting("Rk"); log.info ("Hello Raaki!"); } } context.setProperty("Raaki",new Raaki(log,context,testRunner)); Error in SoapUI: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script2.groovy: 2: unable to resolve class com.raaki.demo.HelloWorld @ line 2, column 1. import com.raaki.demo.HelloWorld; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class com.raaki.demo.HelloWorld @ line 2, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:149) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1225) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:178) at org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:651) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:694) at groovy.lang.GroovyShell.parse(GroovyShell.java:706) at groovy.lang.GroovyShell.parse(GroovyShell.java:742) at groovy.lang.GroovyShell.parse(GroovyShell.java:733) 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:141) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 1 error12KViews0likes0CommentsRe: Unexpected token in Groovy Scripting.
No luck :(JHunt Code: import com.raaki.demo.HelloWorld; class Raaki{ def context; def log; def testRunner; def Raaki(log,context,testRunner){ this.log=log; this.context=context; this.testRunner=testRunner; } def method(){ def obj=new HelloWorld(); def str=obj.greeting("Rk"); log.info (str); } } context.setProperty("Raaki",new Raaki(log,context,testRunner)); Error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 2: unable to resolve class com.raaki.demo.HelloWorld @ line 2, column 1. import com.raaki.demo.HelloWorld; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class com.raaki.demo.HelloWorld @ line 2, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:149) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1225) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:178) at org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:651) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:694) at groovy.lang.GroovyShell.parse(GroovyShell.java:706) at groovy.lang.GroovyShell.parse(GroovyShell.java:742) at groovy.lang.GroovyShell.parse(GroovyShell.java:733) 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:141) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 1 error12KViews0likes0CommentsRe: Unexpected token in Groovy Scripting.
Thank you JHunt for the quick response :) I corrected that mistake but now getting "Unable to resolve error". Below is my code in Soap UI import com.raaki.*; class Raaki{ def context; def log; def testRunner; def Raaki(log,context,testRunner){ this.log=log; this.context=context; this.testRunner=testRunner; } def obj=new HelloWorld(); def str=obj.greeting("Rk"); def method(){ log.info (str); } } context.setProperty("Raaki",new Raaki(log,context,testRunner)) Error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script33.groovy: 14: unable to resolve class HelloWorld @ line 14, column 10. def obj=new HelloWorld(); ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class HelloWorld @ line 14, column 10. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:149) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:264) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:274) at org.codehaus.groovy.control.ResolveVisitor.transformConstructorCallExpression(ResolveVisitor.java:1049) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:708) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitField(ClassCodeExpressionTransformer.java:68) at org.codehaus.groovy.control.ResolveVisitor.visitField(ResolveVisitor.java:215) at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1078) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:53) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1263) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:178) at org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:651) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:694) at groovy.lang.GroovyShell.parse(GroovyShell.java:706) at groovy.lang.GroovyShell.parse(GroovyShell.java:742) at groovy.lang.GroovyShell.parse(GroovyShell.java:733) 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:141) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 1 error12KViews0likes3CommentsUnexpected token in Groovy Scripting.
My agenda is to create a greeting() method inside the HelloWorld class using Eclipse and want to use the same method in Soap UI open source by importing that jar file. Steps I've followed: 1. Created simple program in Java (This is the only class present in the Java Project) 2. Exported the complete Java Project as runnable jar and placed */bin/ext folder and restarted Soap UI 3. Below is the code from Soap UI Groovy editor. 4. When I try to the program from Soap UI, getting the following error. Is there any step that I missed? Would be grateful if anyone could help :)12KViews0likes5CommentsPOI jars required for Groovy in Soap?. | Receiving "unable to resolve class Workbook" in Soap UI.
I know that this question has been asked many times in many forums. But I couldn't find exact answer. Could anyone please list down the POI jars required for Groovy in Soap UI. I've copied all the required Jars to SOAP_HOME/bin/ext but still getting "unable to resolve class Workbook" error in console. Following are the Jars that I've added.621Views0likes0CommentsHow to run "Receive MQTT Message" in SoapUI?
My requirement is to hit the Soap request in SoapUI and have to check the MQ (using RFH Util to access Queue Manager) for the presence of respective message. I've added one "Soap TEST" under the testcase in SoapUI. Rather than going to RFHUtil, how can I check the message from SoapUI itself using "Receive MQTT Message" step?1.6KViews0likes1Comment- 1.1KViews0likes1Comment