Set Dynamic Value in ATF Set Variables value step for record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 03:32 AM
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 :
- javascript:ATFUtil().ReturnStartDate()
- 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 01:06 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 12:09 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2020 03:41 PM
Use the below code instead
javascript:gs.daysAgo(0) for current and
javascript:gs.daysAgo(-1) for future dates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 08:08 AM
This works. Thank you, @Abbas Abidi1!