Forum Discussion

MarcusBengtsson's avatar
Frequent Contributor
2 years ago

How to check a modified time that will differ every time

Hello! So I am trying to check a "Modified" column. Which contains date and time. This one will always be different each time I run the test and create a NEW one.

However.. I want to check the first date, then make modification to the object and save and check that the modified column have been updated. How would I do this?


Do I need to use some variable as it is constantly changing? I am not very good at this so would appreciate some help.

5 Replies

    • MarcusBengtsson's avatar
      Frequent Contributor

      Hello! Will try to explain it a bit better hopefully.


      In this picture you can see the column "modified". I want TC to "check/save" this and next time I modify I want it to check that this got updated. Aka doesnt compare to the last check/save before. 


      But I dont know how to make this as this modified will always be changed each time I make a new one.


      Also I am working with keyword testing atm.

  • MarcusBengtsson's avatar
    Frequent Contributor

    How would I use the aqDateTime into this? 

    or will I need to be using scripting instead?

  • MW_Didata's avatar
    Regular Contributor

    I wrote this little function but you could also use code snippet,

    In the next image if you save the date from the column to a variable and assign it to datum1

    Then enter (as code expression) to datum2

    I would also take a substring of just the date to not test the time itself, since that is down to ms it makes it hard to compare.

    Basically this code checks if date1 = date 2 and returns a result

    Keep in mind that the script is written in VBS, however if you check the link I send you before you should be able to get the same code in different languages