3

I wonder if there is a tool that can track changes in html file (DOM) like new HTML elements added to the page, old elements was removed, elements location have changed, this tool would be able to track the changes and to display what is the differences between both of the files.

I will explain using an example: if I browse to google search page (saving the DOM to a file) then I navigate again to google search page again , saving the DOM to another file and now I want to compare both of the files and to display what was changed like I wrote before (old elements was removed, elements location have changed).

thanks!

tupac shakur
  • 658
  • 1
  • 12
  • 29
  • notepad++ has an extension that allows you to compare 2 files – Pete Dec 12 '18 at 08:48
  • Have you seen https://stackoverflow.com/questions/1871076/are-there-any-free-xml-diff-merge-tools-available – Irek L. Dec 12 '18 at 08:58
  • I assume you want to do it programmatically so check out this question --> https://stackoverflow.com/questions/18955417/compare-two-html-sources-and-display-visual-differences. – Wazniak Dec 12 '18 at 08:59
  • _track changes in html file_ how is it related to _Selenium_ ? Am I missing something? – undetected Selenium Dec 12 '18 at 09:18
  • I assume he wanted to use selenium WebDriver to navigate to some page, store its source in file/variable, do the same operation again and check for differences. Although it wouldn't be the best usage of selenium I can understand how someone might have such idea. – Wazniak Dec 12 '18 at 11:54
  • @wazniak I agree and you correct this is the exact things I want to achieve. – tupac shakur Dec 12 '18 at 22:25
  • @tupacshakur Happy that I understood you correctly. However please go through the links that were provided above and in your question - this should be sufficient help. Additionaly take a look at https://stackoverflow.com/questions/3242640/need-to-compare-2-html-documents-using-java-selenium I can't really provide you with complete solution for your problem + I think you may benefit from searching for a different approach to you problem, cause Selenium may not be a road you want to take – Wazniak Dec 13 '18 at 09:06
  • https://www.adictosaltrabajo.com/2012/06/05/comparar-ficheros-java-diff-utils/ – tupac shakur Dec 13 '18 at 23:12

0 Answers0