1

I want to provide a diff report for a non regression test. Regression test is to compare HTML files and generate report about which files are same and which are not same.

I found one tool called "CS-HTMLDiff", in which I can compare Text or HTML files and generate report in html or in XML file. I was not able to use this tool since i want to perform this tests on ant build but this tool doesn't support command line functionality. (I didn't find any other way to run this tool from code or ant build as it doesn't support command line functionality)

Is there any other tool or java library which can compare html files and generate report? (It is better if its opensource)

I have already read some stackoverflow information but I didn't found any solution for my problem. A customizable diff tool that can produce report (in XML, HTML)

Thanks for your help

Community
  • 1
  • 1
Purushotham
  • 205
  • 3
  • 10
  • Can you check 'Beyound compare' . In that you can compare individual files or folders and you can save the comparison report in HTML format – Gnanz May 09 '13 at 09:47
  • That's "Beyond Compare", and it's pretty sweet. It's not free ($30-$60), but you can produce diff reports in HTML or plain text and with a variety of different options. I highly recommend it; I use it for all my file comparison needs, such as source code file compares. – Frecklefoot May 17 '16 at 14:02

1 Answers1

0

You might try DaisyDiff, a Java library that diffs (compares) HTML files. It highlights added and removed words and annotates changes to the styling.
Either use commandline (see DaisyDiff examples) or java api. See Main Class and DaisyDiff Class to get you going.
Here is a blogpost (in german) with some snippet generating a html report.

EDIT after comment

To simply check if there are any differences and catch those files, you don't need any addons,
use something like :

<project>
<fileset dir="/path/to/folder1" includes="**/*.html" id="diff">
 <different targetdir="/path/to/folder2" ignoreFileTimes="true"/>
</fileset>

<pathconvert refid="diff" pathsep="${line.separator}" property="htmldiff"/>
<!-- if fileset diff is empty, ${htmldiff} and htmldiff.txt are also empty -->
<!-- echo to file, one file per line -->
<echo file="htmldiff.txt">${htmldiff}</echo>
</project>
dushan
  • 7
  • 2
Rebse
  • 10,307
  • 2
  • 38
  • 66
  • Thanks for your answer. I think report generated by DaisyDiff shows difference between the files, but I need to compare large number of html files at once and need to generate report which should show only compared files are same or not. (Just like JUnit report which contains tests are passed or not, I need report that compared files are same or not). @Rebse – Purushotham May 09 '13 at 14:31
  • Did you get the line where the NPE occurs ? – Rebse Sep 25 '13 at 20:53