Forum Discussion
HimanshuTayal
Community Hero
sonya_m ,
Yes we can generate today's date via dynamic property but as per me it will be a duplicacy to write same code again and again to overcome this what we are doing is writing a small script in TestController to generate Date in our desired format and storing it in project level
and using it in our Request from there.
def startDate = new Date() def date = startDate.format("dd-MM-yyyy"); testRunner.testCase.testSuite.project.setPropertyValue("currentDateDDMMYYYY_Format",date.toString());
nmrao
5 years agoChampion Level 3
It becomes static value then if the same is used in the test run.
Dynamic property is intended for one line of code. So, no optiomation can be done for one line code, I guess.
EDIT: There was typo, not online, meant for one line.
By the way, Dynamic properties is there for reason to simplify the work i.e., directly evaluate the value within the request using the expression which is better way than compute the value in a script, set it in property and retrieve it before submitting.the request.
Dynamic property is intended for one line of code. So, no optiomation can be done for one line code, I guess.
EDIT: There was typo, not online, meant for one line.
By the way, Dynamic properties is there for reason to simplify the work i.e., directly evaluate the value within the request using the expression which is better way than compute the value in a script, set it in property and retrieve it before submitting.the request.
- HimanshuTayal5 years agoCommunity Hero
if it's only intended for online purpose than it's ok but one should not use it in project work.
- nmrao5 years agoChampion Level 3Corrected typo. Meant that one line.
Dynamic property works in SoapUi project, not online.
Thanks for catching typo.- HimanshuTayal5 years agoCommunity Hero
nmrao :
Seems i have proved that i have 1 quality of good tester, finding a bug
:) :smileylol: :smileylol: :smileylol: :smileylol:
Related Content
Recent Discussions
- 4 days ago
- 9 days ago