How can I change date in my test step?

4 posts, 0 answers
  1. Yuriy
    Yuriy avatar
    13 posts
    Member since:
    May 2015

    Posted 08 May 2015 Link to this post

    Hello, Telerik Team!

    I am QA. I am trying to create test step where date will be = current date + some  days.

    When I recorded test I chose required date. But if I will execute same test tomorrow - date will be wrong.

    Unfortunately, I don't have programming skills.

    Date format - 5/8/2015 (m/d/yyyy)

    Looking forward on your response. 

     

  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 13 May 2015 Link to this post

    Hello Yuriy,

    This can be done in a coded step.

    Here is a code example which takes the current date and convert it to string in dd/mm/yyyy format:

    DateTime today = DateTime.Today;
    string currentDay = today.ToString("dd/MM/yyyy");

    Let me know if this helps.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Yuriy
    Yuriy avatar
    13 posts
    Member since:
    May 2015

    Posted 13 May 2015 in reply to Boyan Boev Link to this post

    Hello, Boyan!

    By means of your example I was able create test step which I need !

     Also I understood how can I change date:

               today = today.AddDays(2);

     

    Thank you for your help!

     

  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 14 May 2015 Link to this post

    Hello Yuriy,

    I am happy to hear that.

    If you need further help please let us know.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top