This is a migrated thread and some comments may be shown as answers.

Reusable compare date function

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Leon
Top achievements
Rank 1
Leon asked on 28 Jan 2016, 11:50 PM

Hello,

 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,

Leon

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 29 Jan 2016, 04:27 PM
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.


Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Leon
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or