06-05-2009, 03:35 PM
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 to select the date from Calender table
'********************
'*******************
'Select Date on any DMS page
'*******************
Code:
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
'********************
Code:
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