Set current date as dynamic field value

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 03:59 AM
I'm trying to use ATF to test the Change process, and when closing off the implementation phase I would like to use the current date set programatically, rather than having to set this manually before running the test. I don't seem to see any options for setting dynamic date/time values when setting up test steps, does anyone know if this is possible?
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:08 AM
As I mentioned in my first response, for the Date field we need to use below
javascript: gs.nowDateTime().getDate();
without calling getDate() it will return Date and Time which will cause a problem here.
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:13 AM
If you will see my reply I have mentioned clearly which test step he has to use in order to do that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:36 AM
Hi,
Refer below links.
Mark it correct and helpful.
Thanks
Bhagyashri Sorte.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:57 AM
you should set the local date as below in the ATF test steo
javascript: new GlideDateTime().getLocalDate();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader