I have a calender page in which the available dates are visible in green colours and non available dates are in gray colours.
It is a VB based application.I have to select one of the available dates from this window.
I dont know how to work with colours using QTP.Please suggest some proper ideas to work in this situation.
This depends on the calendar control. If the "days" are implemented as seperate buttons just record a click on a "day" and then replace the .Click method by a .Object method and append a . (dot), such as:
If you append the dot at the end of the line you should be able to see which runtime properties are available for the control. Go through the list and try to find something like "foreColor", "fontColor" or maybe just "color". This depends on how the calendar is implemented.
If the calendar is a single object (the days are not seperate objects) then it will be more difficult. You will see if you can interface the calendar control directly to retrieve it's internal state.
It could be easier to just click every day in the calendar in a loop and check if it can be selected. Maybe the date is displayed in a VBEdit control or so where you can check the value? Or maybe (I don't know your app) another window opens when you click a green date?