Ask a Question

How to add today's date to a step in test complete -

SOLVED
saranoor
Frequent Contributor

How to add today's date to a step in test complete -

When I click on that Field a calendar is displayed and I can see that todays date is highlighted.

Attaching Screenshots of teh step and the UI.

 

3 REPLIES 3
tristaanogre
Esteemed Contributor

Easy sample code to demonstrate

 

Log.Message(aqDateTime.Today())


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
saranoor
Frequent Contributor

So write this as a script  and call it in that step? run the script at that step?

Log.Message(aqDateTime.Today())

tristaanogre
Esteemed Contributor

That script is simply an example of how to get today's date.  It demonstrates logging to the test log the date as is.

If you need to use the date for some other purpose, you would use the aqDateTime.Today() method in that vein.

However... without more specifics of EXACTLY what you're trying to do, all I can do is give the general reference.

 

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqdatetime/today.html


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: