Forum Discussion

testlc's avatar
Occasional Contributor
11 years ago

create PDF report with groovy

Dear All,

Much appreciate if you could help me out,

I am trying to create PDF report via groovy from soapui pro after each security test run, i am using below scripts, I can see the result data in Xml, CSV exported but NOT in the pdf format, please do kindly help:-)

def tc = testRunner.testCase
def st = tc.getSecurityTestList()
def report = new SecurityTestCaseReport(st[0]) // st[0] is the security test case
def AvailableReports = ReportEngineRegistry.getAvailableReports( report ) // get list of all reports for test case
AvailableReports[1].generate( report.getModelItem().getSettings(), (String[])[ "CSV","XML" ], folder)
AvailableReports[0].generate( report.getModelItem().getSettings(), (String[])[ "PDF" ], folder)
  • ShikharSaxena's avatar
    8 years ago

    HI Rao,


    Problem got resolve after including below class



    Thanks for your help




9 Replies

  • redfish4ktc2's avatar
    Super Contributor
    Hi, if you are using Soapui Pro, you should post in the pro forums to get support from SmartBear
  • ShikharSaxena's avatar
    Occasional Contributor

    Hi guys, I know its off topic now but need help on above topic ,While trying this I am getting below exception


    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    Script4.groovy: 8: unable to resolve class SecurityTestCaseReport
    @ line 8, column 14.
    def report = new SecurityTestCaseReport(st[0])
    org.codehaus.groovy.syntax.SyntaxException: unable to resolve class SecurityTestCaseReport
    @ line 8, column 14.
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(
    at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(
    at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(
    at org.codehaus.groovy.control.ResolveVisitor.transformConstructorCallExpression(
    at org.codehaus.groovy.control.ResolveVisitor.transform(
    at org.codehaus.groovy.control.ResolveVisitor.transformDeclarationExpression(
    at org.codehaus.groovy.control.ResolveVisitor.transform(
    at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(
    at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(
    at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(
    at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(
    at org.codehaus.groovy.ast.ClassNode.visitContents(



    Request to please tell me which jar or import statement required to resolve this problem

    • nmrao's avatar
      Champion Level 3
      Wild guess - try adding junit library to classpath.
      • ShikharSaxena's avatar
        Occasional Contributor

        HI Rao,

        Thanks for prompt reply ,

        but I am executing above code in groovy test step.

        Also when we use def report = new WsdlTestCaseReport(context.testCase) its execute without any error .

        but unfortunately not for def report = new SecurityTestCaseReport(st[0])


        Note : I  am using Pro version