Forum Discussion

alinder's avatar
alinder
Contributor
13 years ago

Verifying printed output

We have to verify printed data from our application under test, across a number of generations of the operating system. What we currently do is automate an additional application that prints the data to a multipage image file, then perform image comparisons on the component pictures. Though the solution works, it is somewhat awkward, brittle, and incurs a number of project risks due to compatibility and configuration across different systems.



Could there be a better way to do this within TestComplete without having to rely on an intermediary application?
  • TonyMro's avatar
    TonyMro
    Occasional Contributor
    Your level of success with validating the contents of printed documents will vary depending on what content you want to validate, and the format of the document. If you are only interested in verifying the correctness of the report data and not the formatting, then you should print your report as a plain text document and parse the content accordingly. There are utilities available to print documents to raw text or you may use a conversion tool to save a .PDF or .DOC file as a .TXT file that you can parse.



    If you are concerned about verifying the formatting of the document content, and are able to print your reports to various formats (PDF, RTF, MS Word, MS Excel), you may be able to use the various APIs that are available for parsing PDF, Word, and Excel documents. I have used this approach to verify the data content and formatting of both Word and Excel docs produced by our AUT.
  • Thanks for your thoughts. The selection we can make given the functionality of the AUT is pretty much selecting the printer/print driver. The printed output that must be verified includes both graphics and text. Another approach would be to print to a PDF driver, but I don't think there is any built-in facility for PDF comparisons, either, so again we would be reliant on an external tool and doing some custom parsing into content we can use.
  • I am afraid of being too presumptive, but maybe this will be more simply phrased like this: It seems reasonable that an automated test tool should be able to compare printed output or compare the content of PDF documents. If this is possible with functionality built into the tool, a pointer to it would help; if not, hear this as a description of a limitation a user of the tool in the field is encountering, and consider noting it as an enhancement request.

  • Hi Andrew,



    TestComplete does not have built-in possibilities to validate printed output or compare PDF files. I have registered your request as a suggestion in our database. Thank you.



    As a possible solution, you can print results to a PDF file and use the MSAA feature to get the file content (Can I use TestComplete to compare PDF files?) or some third-party .NET or Java libraries that allows working with PDF files.