locked
CodedUI test should select the todays date whenever the test runs. RRS feed

  • Question

  • Hi All,

    I have got a scenario where I want to perform a CodedUI test and the test should pick the todays date whenever the test runs on the application. 

    and also the Time which should be 4:30 hours past of the System time. 

    Pls suggest

    Friday, May 23, 2014 12:57 PM

Answers

  • Hi Russel,

    For this requirement, please refer to this code below:

    System.DateTime d = DateTime.Now;
                d.AddHours(-4);
                d.AddMinutes(-30);
    HtmlEdit editControl=[set your control];
    editControl.Text=d.ToString();

    Thanks

    Best Regards              


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 26, 2014 2:29 AM