Forum Discussion
hi
we are not using any maven or ant
we will execute the scripts on request basis.
- nmrao9 years agoChampion Level 3
Below script is taken from SoapUITestCaseRunner class. Refer here. This can generate junit style test result in xml file. Then you can use different approaches to transform xml to html using any of the following:
- stylesheet
- MarkupBuilder
import com.eviware.soapui.tools.SoapUITestCaseRunner def runner = new SoapUITestCaseRunner() runner.with { //change the paths as needed to suit your environment setProjectFile('/path/to/Sample-soapui-project.xml') //Ignore below if you do not have any special settings. setSettingsFile('/path/to/soapui-settings.xml') setOutputFolder('/tmp/results') setPrintReport(true) setExportAll(true) setJUnitReport(true) run() }
If you use ant, it would be simple and do not have to write stylesheet or MarkupBuilder. Use below link for more details.
- raj1234569 years agoOccasional Contributor
hi
am getting the below error messageorg.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script6.groovy: 2: unable to resolve class SoapUIProTestCaseRunner @ line 2, column 25. SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner() ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class SoapUIProTestCaseRunner @ line 2, column 25. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:146) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:222) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:232) at org.codehaus.groovy.control.ResolveVisitor.transformVariableExpression(ResolveVisitor.java:866) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:634) at org.codehaus.groovy.control.ResolveVisitor.transformDeclarationExpression(ResolveVisitor.java:1003) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:638) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:139) at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163) at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1240) at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:50) at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:166) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123) at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1055) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1183) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141) at org.codehaus.groovy.control.CompilationUnit$10.call(CompilationUnit.java:632) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:912) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:523) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613) at groovy.lang.GroovyShell.parse(GroovyShell.java:625) at groovy.lang.GroovyShell.parse(GroovyShell.java:652) at groovy.lang.GroovyShell.parse(GroovyShell.java:643) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:138) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:89) 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) Script6.groovy: 2: unable to resolve class SoapUIProTestCaseRunner @ line 2, column 34. SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner() ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class SoapUIProTestCaseRunner @ line 2, column 34. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:146) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:222) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:232) at org.codehaus.groovy.control.ResolveVisitor.transformConstructorCallExpression(ResolveVisitor.java:969) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:646) at org.codehaus.groovy.control.ResolveVisitor.transformDeclarationExpression(ResolveVisitor.java:1010) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:638) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:139) at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163) at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1240) at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:50) at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:166) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123) at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1055) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1183) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141) at org.codehaus.groovy.control.CompilationUnit$10.call(CompilationUnit.java:632) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:912) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:523) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613) at groovy.lang.GroovyShell.parse(GroovyShell.java:625) at groovy.lang.GroovyShell.parse(GroovyShell.java:652) at groovy.lang.GroovyShell.parse(GroovyShell.java:643) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:138) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:89) 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) 2 errors
Can you help me
- nmrao9 years agoChampion Level 3Sorry, there was a typo, fixed the script. Please use the updated one.
- rupert_anderson9 years agoValued Contributor
Hi,
Can you explain a little more about how you would like the report to look, what details to render in it and when/how you would like to trigger it?
If you have had a look already at what data you can get when a TestCase has completed, a good place to start is tip 8.2 in https://www.soapui.org/scripting-properties/tips-t
ricks.html Which shows an example of a (TestSuite) Tear Down Groovy script that iterates over the runner.results collection and for each TestCase that failed, the iterates over the TestSteps and logs each failure message. In the past I have put Groovy code in a tear down script to build a custom XML report.
I am actually quite interested in developing a SoapUI reporting script or plugin, so this could be an opportunity to work together or at least share ideas.
Thanks,
Rupert
- raj1234569 years agoOccasional Contributor
Hi
attached my requirement
and we are not interested to use any continuous integration tools like Jenkins/Hudson/Maven/Ant
Project
- Test Suite Groovy
- testcase
- teststep
- grrovy code
- teststep
- testcase
- Test Suite Groovy
- Method1
- operation1
- operation1
- operation1_positivetestcase
- operation1_Negativetestcase
- operation2
- operation2.1
- operation2.1_positivetestcase
- operation2.1_Negativetestcase
- operation2.2
- operation2.2_positivetestcase
- operation2.2_Negativetestcase
- operation3
- operation3.1
- operation3.1_positivetestcase
- operation3.1_Negaaivetestcase
- operation3.2
- operation2.2_positivetestcase
- operation2.2_Negativetestcase
- operation3.3
- operation3.3_positivetestcase
- operation3.3_Negativetestcase
- operation4
- operation4.1
- operation4.1_positivetestcase
- operation4.1_Negativetestcase
- operation4.2
- operation4.2_positivetestcase
- operation4.2_Negativetestcase
- operation5
- operation5.1
- operation5.1_positivetestcase
- operation5.1_Negativetestcase
- Method2
- operation1
- operation1
- operation1_positivetestcase
- operation1_Negativetestcase
- operation2
- operation2.1
- operation2.1_positivetestcase
- operation2.1_Negativetestcase
- operation2.2
- operation2.2_positivetestcase
- operation2.2_Negativetestcase
- operation3
- operation3.1
- operation3.1_positivetestcase
- operation3.1_Negativetestcase
- operation3.2
- operation2.2_positivetestcase
- operation2.2_Negativetestcase
- operation3.3
- operation3.3_positivetestcase
- operation3.3_Negativetestcase
- operation4
- operation4.1
- operation4.1_positivetestcase
- operation4.1_Negativetestcase
- operation4.2
- operation4.2_positivetestcase
- operation4.2_Negativetestcase
- operation5
- operation5.1
- operation5.1_positivetestcase
- operation5.1_Negativetestcase
- Method3
- operation1
- operation1
- operation1_positivetestcase
- operation1_Negativetestcase
- operation2
- operation2.1
- operation2.1_positivetestcase
- operation2.1_Negativetestcase
- operation2.2
- operation2.2_positivetestcase
- operation2.2_Negativetestcase
- operation3
- Method4
- operation1
- operation1
- operation1_positivetestcase
- operation1_Negativetestcase
- operation2
- operation2.1
- operation2.1_positivetestcase
- operation2.1_Negativetestcase
- operation2.2
- operation2.2_positivetestcase
- operation2.2_Negativetestcase
if groovy code executes all the Methods and test cases will execute
want to see the report how many are Passed and How many are failed
find attached the screenshot
Related Content
- 12 years ago
- 4 years ago
- 3 years ago
Recent Discussions
- 15 years ago