Reusable compare date function

2 posts, 0 answers
  1. Leon
    Leon avatar
    2 posts
    Member since:
    Dec 2015

    Posted 28 Jan 2016 Link to this post


     I would like to compare an extracted date value from a txtbox or datepicker control.  There are multiple places in the application that we would have to verify that the current date is displayed.  So I would like to write this once and be able to reuse the function.  Has anyone done this before or have any ideas on how to do this?

     My initial thoughts would be to create a stand alone test with a coded step that compares an extracted date variable to 'DateTime.Now.ToString("M/dd/yyyy").  Then anytime I needed to compare dates I would always use the same extracted variable name.  Is this something that would work anywhere in a project?  

    Thanks for your thoughts,


  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 29 Jan 2016 Link to this post

    Hello Leon,

    You can use an utility class for this.

    It will contain global variables or functions in Test Studio Standalone version that are accessible from all the tests within the test project. 

    Let me know if this can help you.

    Boyan Boev
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top