How to check a modified time that will differ every time
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Labels:
-
Keyword Tests
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 aqDateTime.compare,
Then to check if the date equals today compare against aqDateTime.Today.
Otherwise here is all the things TC can do with dates:
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqdatetime/methods.html
I hope this helps.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would I use the aqDateTime into this?
or will I need to be using scripting instead?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 aqDateTime.today (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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
to assign a date to a var you could use 'set var value: Aliases.etc.etc.etc.date.Value or .Text
then to get just the date and not the time use:
