How to give dynamic date in Set field value step in ATF

SLK Gupta
Tera Guru

Hello experts,

Need your help in ATF test step.

in the "set field value" step for planned start date and planned end date i want to give dynamic date instead of a static date to run the ATF' tests seamlessly without modifiying them for every time i run the script.

I want the current date +3 minutes 10 seconds,

SLKGupta_0-1717134307848.pngexample current date & time : 31/05/2024 22:05:20
my expoected date & time : 31/05/2024 22:08:30

which is 3 minutes 10 seconds greature than the current time.
i want to do the same for planned end date as well.

is there a way i can do it?
your assistance is highly appreciated

Thanks & Regards,
Gupta.

1 REPLY 1

Valmik Patil1
Kilo Sage

Hello @SLK Gupta ,

Please write instead date in that field like below

 

 

 

javascript : new GlideDateTime().addMinutes(3); // this will return current date and time and adds three minuites to it

 

 

ValmikPatil1_0-1717135175964.png

or you can write script include and call that script here instead of this.

Try writing code in script include to update date after 3 min 10 sec.

 

 

Thanks ,

Valmik Patil