Ask a Question

How to check a modified time that will differ every time

Frequent Contributor

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.

Frequent Contributor

Could use some more information to understand what you mean,

But i think what you mean is to compare dates

If the date is on screen you could save that to a variable and use,

Then to check if the date equals today compare against aqDateTime.Today.


Otherwise here is all the things TC can do with dates: 

I hope this helps.

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.

Frequent Contributor

How would I use the aqDateTime into this? 


or will I need to be using scripting instead?

Frequent 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

Frequent Contributor

to assign a date to a var you could use 'set var value:  or .Text

then to get just the date and not the time use: 

Showing results for 
Search instead for 
Did you mean: