Set Dynamic Value in ATF Set Variables value step for record producer

Bhavani10
Kilo Contributor

 

Hi Team,

Greetings!! 

We are trying to set the value of Start Date and End Date Variables dynamically using Set Variables Value(SP) step in ATF.To achieve this,

We are trying to code inside Set Variable Value(SP) step

 

Example :

  1. javascript:ATFUtil().ReturnStartDate()
  2. javascript:gs.beginningOfToday()

 

We want our ATF test suites to be reusable,

When we set static Value, we end up changing our test step every time we run our test.

Could you please let us know If we can code inside the setValue step?

 

Regards,

Bhavani

5 REPLIES 5

Masha
Kilo Guru

You should be able to use global javascript calls to set the date like javascript: new Date();, which worked for me in setting a catalog item variable SP.

My guess is that values get set client side here and so GlideSystem and other server side calls would not be available here. 

Bhavani10
Kilo Contributor

find_real_file.png

 

Am doing the same , It does not work for me 

Use the below code instead

javascript:gs.daysAgo(0) for current and

javascript:gs.daysAgo(-1) for future dates.

This works. Thank you, @Abbas Abidi1!