How to Select a Date from Datepicker using Coded UI Test ?

Oct 9, 2012 at 9:27 AM

I am facing problem in selecting a date using Datepicker in CUIT of VS 2010, can anyone please help.


Karthik KK

Oct 9, 2012 at 4:09 PM

Hi Karthik,

What technology (html, silverlight, wpf, or win32)?

Do you have any sample ui and test code that can reproduce the issue?

You can try one of the following code snippets appropriate for your technology:


CUITe_SlDatePicker dp = b.Get<CUITe_SlDatePicker>("Name=datePicker1");
dp.UnWrap().SelectedDateAsString = "5/11/11";

Desktop (win32):

CUITe_WinDateTimePicker dp = app.Get<CUITe_WinDateTimePicker>("Name=datePicker1");
dp.DateTime = new DateTime(2012, 12, 12);


CUITe_WpfDatePicker dp = app.Get<CUITe_WpfDatePicker>("Name=datePicker1");
dp.Date = new DateTime(2012, 12, 12);