Service Virtualization

Expand all | Collapse all

Need to generate some sequential dates in DPH based on the date input string

  • 1.  Need to generate some sequential dates in DPH based on the date input string

    Posted Dec 28, 2017 03:58 AM

    I have to generate some sequential dates in DPH based on the start date input string.

     

    For Eg.

    StartDate="2017-12-30"  //its coming from the VSE request

     

    Following dates need to be generated in DPH at VSM Model, filter section

    StartDate1 = 2017-12-31

    StartDate2 = 2018-01-01

    StartDate3 = 2018-01-02

    StartDate4 = 2018-01-03

    StartDate5 =2018-01-04

    StartDat6= 2018-01-05

     

    Finally i will be setting these dates in different arguments like as follow which will be referred in the VSI response section

    testExec.setStateValue ("stDate1",StartDate1 );

    testExec.setStateValue ("stDate2",StartDate2 ); 

     

    ...  Etc.

     

    Tried multiple ways , could not find the solution. Please help me on this if anyone does already.

     

    Thanks,

    Gowri



  • 2.  Re: Need to generate some sequential dates in DPH based on the date input string
    Best Answer

    Posted Dec 28, 2017 04:43 AM

    Hi Gowri, 

     

    You can try magic date function. 

     

    As your VSE request has date and you want to reflect the other date based on the date in the request. I believe magic date will do this. 

     

    For more info kindly refer - Magic Dates - DevTest Solutions - 9.5 - CA Technologies Documentation 

     

    Thanks, 

    Vinay Nagariya