How to get background color for individual days in SAPGUICalendar with QTP - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: How to get background color for individual days in SAPGUICalendar with QTP (/Thread-How-to-get-background-color-for-individual-days-in-SAPGUICalendar-with-QTP) Pages:
1
2
|
How to get background color for individual days in SAPGUICalendar with QTP - AMirza - 12-11-2013 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 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! RE: How to get background color for individual days in SAPGUICalendar with QTP - AMirza - 12-13-2013 Is their no one out there that can help it is very urgent please!!!!! RE: How to get background color for individual days in SAPGUICalendar with QTP - sshukla12 - 12-17-2013 Hi, Not sure but instead of GetRoProperty try to use DOM. Regards, Sankalp RE: How to get background color for individual days in SAPGUICalendar with QTP - AMirza - 12-17-2013 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") 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. RE: How to get background color for individual days in SAPGUICalendar with QTP - sshukla12 - 12-17-2013 Hi, I had never worked with SAP object but u can use the below as a reference; Code: Dim objWeb,objAll Hope this help u. Regards, Sankalp RE: How to get background color for individual days in SAPGUICalendar with QTP - AMirza - 12-17-2013 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") Maybe I am missing something very simple, really hope someone can shed somelight into this. RE: How to get background color for individual days in SAPGUICalendar with QTP - MVChowdary - 12-17-2013 There is no "backgroundcolor" property for the SAPGuiCalendar object. You can check in OR or Object Spy the available properties for this object. You could however acces the object's internal properties and methods with the help of the .Object property and use them for this purpose. For example, for SAPGuiCalendar.Object. there is a GetColor function. But more information about this or other internal properties and methods you can find in relevant SAP GUi API (scripting) documentation. For more information about .Object property, please check here: http://support.openview.hp.com/selfsolve/document/KM177318 Thank you, Veeru RE: How to get background color for individual days in SAPGUICalendar with QTP - AMirza - 12-17-2013 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") 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! RE: How to get background color for individual days in SAPGUICalendar with QTP - AMirza - 12-19-2013 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") RE: How to get background color for individual days in SAPGUICalendar with QTP - basanth27 - 12-20-2013 Unfortunately, I have not worked on SAP applications. I Would be of least help to you, However, I am willing to share my General Knowledge with you if that probably may lead you to the right answer. It is clear that GetColor is not the correct method to be used here or rather it is not returning back the value it should. You should look for a different method or option here. Here is what I would do, 1. Drill down the spied color cell object and check if you have Items.Cells or some hirearchy as below. Look for BackgroundColor or Color or BGcolor which may have a HexaDecimal value for the Green Color. 2. It is most likely that the Cell could be a object here which holds the color property. Try to look for the color property in that direction. 3. If you have hit the wall without any option and if you have the luxury of a developer sitting beside you who has developed it or rather who has access to the codebase, then talk to him and see what is the property being set for that object. He should be able to exactly show you how the color value is being set and to which object it corresponds. You may already have read this but if you havent this may be of some help. (http://help.sap.com/saphelp_46c/helpdata/en/9a/b86f371db63568e10000009b38f8cf/frameset.htm) Finally, dont lose hope. Try to google around your problem, post your query on multiple sites and keep looking. Every problem has a solution and without a solution there does not exist a problem |