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

Oct 9, 2012 at 10:27 AM

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

Thanks.

Karthik KK

Coordinator
Oct 9, 2012 at 5: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:

Silverlight:

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);


Wpf:

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