(06-12-2009, 05:40 PM)sivashankar_d Wrote:(06-05-2009, 03:35 PM)abrakh Wrote: [quote='sivashankar_d' pid='5664' dateline='1244022657']
QTP 9.5 doesn't detect date picker control for a windows application while recording.I have selected .Net,web and WPF addins. Can anyone let me know how to make qtp identity date picker control??
Hi I faced similar problem in one of my proj. The workaround was click on the image(calender) wait for 2 secs till it appear and use this function.(ofcourse you need to have your objects in OR)
'*******************
'Select Date on any DMS page
'*******************
Function SelectDate(k)
k = CDate(k)
k1 = Cstr(MonthName(month( k)))
k2 = CStr (year(k))
k3 = Cstr(day(k))
Browser("DMS").Page("DMSPage").WebList("ddl_Month").Select k1
Browser("DMS").Page("DMSPage").WebList("ddl_Year").Select k2
'*******************
'Function to select the date from Calender table
'********************
For i = 0 to 1
If Browser("DMS").Page("DMSPage").WebElement("html tag:=FONT","innertext:="&k3,"index:="&i).exist Then
str1 = Browser("DMS").Page("DMSPage").WebElement("html tag:=FONT","innertext:="&k3,"index:="&i).getroproperty("outerhtml")
If instr (str1, "black") or instr (str1, "red") Then
Browser("DMS").Page("DMSPage").WebElement("html tag:=FONT","innertext:="&k3,"index:="&i).Click
wait 1
Exit for
End If
End If
Next
End Function
I am testing it for .net Windows forms.I have manually added SwfCalendar to object repository.Tests passes but Date is not set.

