How to get background color for individual days in SAPGUICalendar with QTP
[ Edited ]


I would really appreciate someones help to work out the code to retrieve background color for the individual SAPGUICalendar days using GetROProperty. This is a client requirment we are trying to output days from the SAP GUI Calendar the days which have background color green, these are days off during the weekdays of the month.

example of code used

SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").Maximize

Dim hWndSource

hWndSource = SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").SAPGuiCalendar("Calendar").GetROProperty("backgroundcolor","28/Dec/2010")

msgbox hWndSource

The issue with above code is that it gives me a blank message were I am expecting a green color value.


The only methods I am able to use with Object. are the following:
Object.GetColor("selecteddate:=28/Dec/2010") this gives me the value 0 if I select another date with different background color I still get value 0 with this method
Object.GetColorInfo() for this method I am unable to make it work as I have to enter a color within the bracket of this method so not sure what value to input

Also I have used the following:

msgbox SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").SAPGuiCalendar("Calendar_2").GetROProperty("color","selecteddate:=28/Dec/2010")

but for this code I get a blank message no value being returned.


Also Seems like the SAPGuiCalendar object does not support this property/method currentStyle so i am unable to capture color using this method/property.

I have attached a screen shot of the individual days (green boxes) within SAPGUICalendar that I am trying to capture the color value of with QTP.

Thanks in advance!



P.S. This thread has been moved from Quality Center Support and News Forum to Unified Functional Testing (formerly QTP) News and Support Forum. - Hp Forum Moderator