Micro Focus QTP (UFT) Forums
How to test PDF format report using QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to test PDF format report using QTP (/Thread-How-to-test-PDF-format-report-using-QTP)



How to test PDF format report using QTP - shilupg - 09-17-2010

Hi,

The project which i am currently working contains PDF reports.
Can anyone of you give a solution to test this using QTP

Thanks,
Shilu


RE: How to test PDF format report using QTP - NevadaMike - 01-19-2011

Here's a link to an API I found to be VERY useful! Install the API and review its docs and your set.

I wanted to verify a proper PDF was being created, so once the API was installed, here's what I did with their code:

' This is to verify that the PDF is the Master Report document. It should have "Master Report" for its first 13 characters.
' *** Initialize the API ***
Set oPDF=createobject("LearnQuickTest.ManipulatePDF")
PDFText=oPDF.GetPDFText ("C:\NEW.pdf")

' *** Verify the first 13 characters ***
CheckedPDFText=Left(PDFText,13)

' *** Show me the first 13 characters ***
Print "PDFText=" & CheckedPDFText ' Just a visual check for me

' *** Document the test results ***
Code:
If (CheckedPDFText="Master Report") then
    Print "PDF verification SUCCEEDED!"
else
    Print "PDF verification FAILED!"
End if