Forum Discussion

Nancy2's avatar
Nancy2
Occasional Contributor
6 years ago

how to increment date for each test run

Hi,   In my test step I need to pass new date in each test run. How can I do that?   Regards, Preeti
  • nmrao's avatar
    nmrao
    6 years ago

    Nancy2 ,

     

    In your test case, place below a Groovy Script test step before the Request test step, so that it can generate the next date and also remembers the same for next time not to generate the duplicate date.

     

     

    And in the request, use <element>${#TestCase#NEW_DATE}</element>

     

    Here is the text of the above script

    https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/date/CreateNewDate.groovy

     

    Doesn't require any additional libraries.