Forum Discussion

Sandyapitester's avatar
Sandyapitester
Frequent Contributor
8 years ago

PDF result report creation in soapui using groovy scripting

Hi All,

 

I have created a test suite for my automation am able create in junit dynamic report in html format.

 

but am looking for standard report in PDF format

 

how to create PDF report in soapui opensource using groovy scripting 

 

if anyone have the solution plz share your thoughts!

 

awaiting your valuable updates, because it would be helpful and useful for my automation

2 Replies

  • rupert_anderson's avatar
    rupert_anderson
    Valued Contributor

    Hi,

     

    Do you have any actual content / text that you would like to write to the PDF?

     

    To create a very simple PDF from Groovy in SoapUI, maybe consider the iText (http://developers.itextpdf.com/examples-itext5). Here is a simple script to get you started, it works from a Groovy TestStep (or tear down script etc):

     

    import com.itextpdf.text.Document;
    import com.itextpdf.text.DocumentException;
    import com.itextpdf.text.Paragraph;
    import com.itextpdf.text.pdf.PdfWriter;
    
    Document document = new Document();
    
    PdfWriter.getInstance(document, new FileOutputStream("/Users/test/soapuiblog/test.pdf"));
    document.open();
    document.add(new Paragraph("Hello SoapUI!"));
    document.close();

    You'll need to include the itextpdf-5.5.9.jar (or similar version 5) into the SoapUI java/app/bin/ext directory and restart.

     

    Obviously, the PDF structure can be improved, but at least you can find tons of examples for iText 5.

     

    If you need help obtaining the SoapUI test results in order to feed them into the report, then let me know.

     

    Regards,

    Rupert

    • Sandyapitester's avatar
      Sandyapitester
      Frequent Contributor

      Awesome bro, let's give a try will reach u once implemented..