Forum Discussion

sastowe's avatar
sastowe
Super Contributor
13 years ago

don't understand files.check

I want to check a PDF to a known good that is stored with the stores. I have



Files.MyFile_pdf.Check "C:\Project path\OutputFiles\MyFile.pdf", 0



I get a The file checkpoint ... failed.



MyFile_pdf item



The files "MyFile_pdf" and "C:\Project path\OutputFiles\MyFile.pdf" are not equal. The files are of different size. 0 bytes are different.

The size of the file MyFile_pdf is 36669 bytes.

The size of the file "C:\Project path\OutputFiles\MyFile.pdf" is 36660 bytes.



Allowed difference: 0 bytes.



Adjust checkpoint parameters to make the next comparison successful.



The last sentence is a link. I click on the link and it says



The difference between the files is 1%



There is a slight difference between the compared files. If you want the checkpoint to report them as equal, set its Allow Difference parameter to 0.



The allowable difference IS zero. I don't understand what to set Allow Difference to to ensure that these files match for this small difference but still report a difference if the file changes some other way. I don't even know why the files are reporting different sizes since they look like they are the same size in Windows explorer and originated from the same mechanism.



I don't understand what I am seeing for the return value of the GetHashValue method when I call it.



Looking at the he;l[p file for the dialog, I see



TestComplete will recalculate the needed parameter values for this checkpoint so that the next comparison is successful. To apply the calculated value, specify it in the checkpoint's parameters manually.



But that is not actually the case.



Can someone help me understand file check better than the help file? Thanks



S


  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Stephanie,


    I failed to reproduce the behavior you describe, so please contact our Support Team and send them your TestComplete project and the .pdf file that is used for comparison (the one that is stored in the "C:\Project path\OutputFiles\" folder).


    As for now, please try using another approach for comparing .pdf files. For more information on possible approaches, please refer to the following FAQ article: Can I use TestComplete to compare PDF files?


    Thanks.

  • sastowe's avatar
    sastowe
    Super Contributor
    I am working with support now on a different issue that involves upgrading to TC 9. Rather than mess around with troubleshooting this in 8, I think I will table this issue until I am done with support on my other issue. Thanks for your help!
  • sastowe's avatar
    sastowe
    Super Contributor
    I think I found the issue. In TC 8.2 the release notes show



    Fixed: File checkpoints reported a zero byte difference for files that were actually different.



    I was running TC 8.1 since 8.6 crashes my app under test. I did not even know that thdere was an 8.2. I will test that version. Thanks.