PDF compare using robot

Hi Everyone.
I am new in Robot and want to ask if there is a possibility to compare 2 PDFs with robot framework. Is there any existing library for doing this?
Best Regards
Omar

Hi @omar1677,

There is a DocTest Library that can be used to compare pdf documents: GitHub - manykarim/robotframework-doctestlibrary: Robot Framework DocTest library. Simple Automated Visual Document Testing.

Here is the link to the keywords: https://manykarim.github.io/robotframework-doctestlibrary/PdfTest.html

Hope this helps.

3 Likes

Also check out the keywords for the visual comparison of PDF documents:
https://manykarim.github.io/robotframework-doctestlibrary/VisualTest.html

4 Likes

Thanks a lot for your answer. I will try it :wink:

Hi Again,
how can i install the library VisualTest ? robot show it red for me
BR
Omar

Many’s link points to: GitHub - manykarim/robotframework-doctestlibrary: Robot Framework DocTest library. Simple Automated Visual Document Testing.

On that page:

Installation instructions
pip install --upgrade robotframework-doctestlibrary

And example usage:

*** Settings *** 
Library   DocTest.VisualTest 
*** Test Cases *** 
Compare two Images and highlight differences 
  Compare Images   Reference.jpg   Candidate.jpg
2 Likes

yes it works. Thanks a lot.
now i have another problem. The files must exists on windows but i want to compare files on Unix server. So after making an SSH connection, i go to a folder but robot can’t find the files i want to compare. any Idea how to solve this?
BR
Omar

You can use the ssh library to copy the files to a local directory first before comparing.
https://robotframework.org/SSHLibrary/SSHLibrary.html

Hello, my PDF files have multiple pages but I observed that it only compares the page 1. How can I make it compare all of the pages? I looked into the document but found none or maybe I missed something.

Is there already an error during the comparison of the first page?
Are you using the Compare Images KW for a visual comparison?

is there a way to solve this?

could you solve the problem?
I use following key word : ‘Compare Pdf Documents’ and for me all pages are compared

1 Like