cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate a dynamic value each test

SOLVED
New Contributor

Calculate a dynamic value each test

Hi there!

 

I would like to use a variable which should be calculated each test. 

For example, I would like to use a particular date (e.g. 01.05.2019).

I choose the "Keys" operation and set 01.05.2019 as Value. 

Next time I want to use another value (e.g. 01.06.2019) but it should be updated automatically. 

 

How can I set a rule to update my current value automatically and add one month each test like:

 

Thank you in advance!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Calculate a dynamic value each test

Hi,

 

Something like this (untested pseudocode):

var strDT = aqConvert.DateTimeToFormatStr(aqDateTime.AddMonths(aqDateTime.Now(), 1), '%d.%m.%Y');

<control>.Keys(strDT);

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
3 REPLIES 3
Community Hero

Re: Calculate a dynamic value each test

Hi,

 

Something like this (untested pseudocode):

var strDT = aqConvert.DateTimeToFormatStr(aqDateTime.AddMonths(aqDateTime.Now(), 1), '%d.%m.%Y');

<control>.Keys(strDT);

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Contributor

Re: Calculate a dynamic value each test

Thanks for the feedback!

 

Could you advise how a code which generates the required variable could be implemented in a KeywordTest?

Currently, I do not use scripts so I'll appreciate any assistance regarding the matter.

 

Community Hero

Re: Calculate a dynamic value each test

New Here?
Join us and watch the welcome video:
Join the September Hub-bub to show off, learn and win