Forum Discussion

jeeejay's avatar
jeeejay
Contributor
12 years ago

Ignore Timestamps in Web Comparison Checkpoint

Hello,



I'd like to use the Web Comparison Checkpoint to make sure that the output (html page) from our tool always matches our template html page (stored uner WebTesting project item).



The code works fine and reports the differences as well however; we have a section on the page where we print the timestamp - the point in time when the output was generated. The comparion method always picks this and reports it as a difference.



I did see options within the editor where one can select different 'modes' however; it would be nice to know if there is a better way of instructing TC to ignore timestamps.



Thanks in advance.



- GJ

6 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi,


     


    There is no built-in feature to ignore values of some tags in the checkpoint. We have an appropriate suggestion in our DB, and your request has increased its rating.


     


    In the meantime, you can compare pages only based on the tag structure, or create your own comparison function.

  • Hi Tanya,



    Thanks a lot for your response. Comparing the pages with 'tag structure' is a good option however; it won't work in my case.



    As for creating my own comparison routine, the only approach I can think of is reading the .htm file as a .txt file and comparing the two files line by line and finally logging the differences.



    It would be nice if you could share your opinion on this approach or provide some other suggestion.



    - GJ
  • Hi Tanya,



    I'm sorry I didn't understand what exactly you need. Can you please elaborate a little?



    As for the timestamp in the html, it is just a simple string in the document. It is not a part of any cell of a table. It's in this particular format - Thursday, February 14, 2013 11:00 PM



    Regards,

    GJ
  • Hi,



    So basically, reading the html file as text file and performing a line by line (and using regular expressions) is the only other alternative I have tight now in my case. Can you please confirm?



    Thanks.



    - GJ