Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get background color for individual days in SAPGUICalendar with QTP
#1
Hi,

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

Code:
SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").Maximize Dim hWndSource hWndSource = SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").SAPGuiCalendar("Calendar").GetROProperty("backgroundcolor","10/Jan/2010") msgbox hWndSource

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

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!


Attached Files
.zip   Trying to identify Individual Days (Green Boxes) with SAPGUICalendar using QTP.zip (Size: 25.69 KB / Downloads: 196)
Reply
#2
Is their no one out there that can help it is very urgent please!!!!!
Reply
#3
Hi,

Not sure but instead of GetRoProperty try to use DOM.

Regards,
Sankalp
Reply
#4
Hi Sankalp,

Thank you for your response.

I had tried the following code:

Code:
hWndSource = SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").SAPGuiCalendar("Calendar_2").Object.GetColor("selecteddate:=28/Dec/2010") msgbox hWndSource

But I get the following output 0.

I then tried to use another date "selecteddate:=30/Dec/2010" which had a different background color in the date cell but again get the same output which is the value 0.

I am therefore not able to capture the difference in color between the 2 date cells for SAPGUICalendar object.

Would really appreciate some help with resolving this problem that I am facing from QTP experts out there in the field.
Reply
#5
Hi,

I had never worked with SAP object but u can use the below as a reference;
Code:
Dim objWeb,objAll Set objWeb=Browser().page().webelement() Set objAll=objWeb.Object backColor=objAll.currentStyle.backgroundColor msgBox(backColor)

Hope this help u.

Regards,
Sankalp
Reply
#6
Hi Sankalp,

Again thank you for your recommendation.

using your code I get the following error message "Object doesn't support this property or method: 'currentStyle'."

Seems like the SAPGuiCalendar object does not support this property/method currentStyle.

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:
Code:
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.

Maybe I am missing something very simple, really hope someone can shed somelight into this.
Reply
#7
Reply
#8
Hi Veeru,

Thank you for your response!

I have tried to use the internal property and method Object.Getcolor example below of code
Code:
hWndSource = SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").SAPGuiCalendar("Calendar_2").Object.GetColor("selecteddate:=28/Dec/2010") msgbox hWndSource

but I get the value 0 as the output and if I use another date which has a different color in date cel then the above date I get the same value 0.
Please advice if I am using the Object.GetColor correctly seems at the moment it is not.

I am unable to open the KM article from the link you had provided i get the following message "You are not authorized to view this document".

I think I am missing something in my code to extract the background color of the SAP GUI Calendar date cell, hoping you can help with this!

Thanks in advance!
Reply
#9
Could someone please guide me on how to use the following code as at the moment the code output value 0:

Code:
hWndSource = SAPGuiSession("Session").SAPGuiWindow("Year Overview 2010").SAPGuiCalendar("Calendar_2").Object.GetColor("selecteddate:=28/Dec/2010") msgbox hWndSource
Reply
#10
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with Text color recognition Treirk 0 1,473 06-17-2019, 12:19 PM
Last Post: Treirk
  Getting background color of an object on mouse over Surya 2 4,558 06-27-2018, 08:51 PM
Last Post: vensas3181
  How can we get the Windows application Text box background color Using UFT 11.53 Kuppampattu 3 6,933 06-06-2017, 11:12 AM
Last Post: workrohit08
  SwfTreeview - Color validation for child item YogeshCallappa 0 2,689 11-10-2016, 04:55 PM
Last Post: YogeshCallappa
  how to get background color of a WinButton javierchen 1 3,570 03-17-2015, 10:59 PM
Last Post: babu123

Forum Jump:


Users browsing this thread: 1 Guest(s)