Forum Discussion

nimishbhuta's avatar
nimishbhuta
Frequent Contributor
7 years ago

How to validate the content in PDF File using TestComplete

Hello All, 

 

I need to validate the content displayed in the PDF with the data in the excel sheet. Please let me know following things :

 

1) How can I read the PDF file content?

2) How can I can compare with the the data in the excel file?

 

If someone has already written some logic on this. Kindly share as it is really thing which I am doing in the project.

 

Regards,

 

Nimish

 

 

13 Replies

    • nimishbhuta's avatar
      nimishbhuta
      Frequent Contributor

      Hello, 

       

      I am following the article for testing pdf with the testcomplete. I have configured JVM and the class path as per the instruction. But if I write the loadDocument  function  in TestComplete script unit  it does not receognize the code as it is in JAVA. 

       

      Can you let me know how can I use this code?

       

      function loadDocument(fileName)
      {
        var docObj;
      
        // Load the PDF file to the PDDocument object
        docObj = JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_3(fileName);
      
        // Return the resulting PDDocument object
        return docObj;
      } 

       

      • nimishbhuta's avatar
        nimishbhuta
        Frequent Contributor

        Hello, 

         

        The article has mentioned about Javascript and it is calling the classes. I am using VBSCript, so can you somebody send across the code for VBScript. 

         

        Regards

         

        Nimish