Forum Discussion

techgirlbb's avatar
techgirlbb
Contributor
7 years ago
Solved

Keyword Test_Current date text field is prepopulated with today's date_how to validate the value

In my windows application I have text field prepopulated with Current date. I inserted property checkpoint and selected "value" property but when I rerun tomorrow it will fail.

My am thinking to writing function to get sys date and pass the Text field value to Variable and compare both. But My team doesn't not want any coding..

How can I validate it using check points

 

  • When you edit the checkpoint, you can change the parameter to be a code expression.  Use

     

    aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%m/%d/%Y')

    This will return a date in the format of mm/dd/yyyy using the current date.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    When you edit the checkpoint, you can change the parameter to be a code expression.  Use

     

    aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%m/%d/%Y')

    This will return a date in the format of mm/dd/yyyy using the current date.

    • lbouchar's avatar
      lbouchar
      Occasional Contributor

      Hello,

       

      What would be the syntax to check a a datetime value in the following format : 2019-07-26 13:19

       

      Thanks

       

      Lynne