Micro Focus QTP (UFT) Forums

Full Version: PDF Validation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have seen several post about PDF validation or 'closing' the browser but none in regards to validating the data on a PDF. I don't need to compare I just need to see if a value is displayed after I create it via the application.

Example: Web application allows the user to select that an Invoice is paid for Cleaning Supplies and the amount paid was $10.50. The Adobe PDF report is opened and simple displays all the Invoices that were paid and the amount paid.

Cleaning Supplies 10.50
Paper Products 5.50
Meat 150.25


I want to verify that "Cleaning Supplies" and "10.50" are displayed. I have seen postings that recommend saving to a text file then check from there, but is this the only way?


Thanks,
Charles
If you have Adobe Acrobat installed on your machine, you can use this to manipulate your pdf files.
like the below examle using AcroExch object to get the number of pages in the pdf file

Code:
Set Acroapp = CreateObject("AcroExch.App")
Set pdf = CreateObject("AcroExch.PDDoc")
pdf.Open <<PdfFile>>,"temp"
Set pdfFile = pdf.GetPDDoc
GetPDFPageCount = pdfFile.GetNumPages
Set pdffile = nothing