![]() |
Checkig color of an image??? - 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: Checkig color of an image??? (/Thread-Checkig-color-of-an-image) Pages:
1
2
|
Checkig color of an image??? - swetha.b - 12-30-2009 Hi all, This is an intresting challenge I got but I am unable to make a move. Please have a look at my attached image. My requirement is this : If I have to select any of the records (listed in the image with checkbox each ) between any specific time period - example from 1/15/2010 to 1/30/2010 - I should only select a record which has the color green (This is the color set to a vacant record - can be seen in the legend below : Green implies vacant) with in the time period specified. so while automating how do I check that which record has the same color as that of the legand 'vacant'?? Do I have to use a bitmap checkpoint ?? but that didnt wrk for me either. any way to go ?? Please help. Thanks Swetha RE: Checkig color of an image??? - Saket - 12-30-2009 what is object there which is having color, can you paste the spyshot? RE: Checkig color of an image??? - swetha.b - 01-02-2010 Hi saket , Here I have attached the spyshot of the object in the grid with colors. QTP is recognizing each small cell with color as one element. Thanks Swetha RE: Checkig color of an image??? - Saket - 01-04-2010 ok, Thats great use '.Object.currentStyle.backgroundColor' to get the background color of your element in each cell. RE: Checkig color of an image??? - bfakruddin - 01-04-2010 HI Saket, I got a small doubt here... Using 'Object.currentstyle.backgroundcolor' we can get the color of that Object... But, as per the question. how can we check any particular 'CheckBox' and selecting desired TimePeriod and get the Color of Cell... Actually It is not identifying as a 'Cell' It is identifying as a 'WebObject' Thanks RE: Checkig color of an image??? - Saket - 01-04-2010 D.Baba Fakruddin - do you have the same application at your side? or just wondering whether both of you are same ![]() what is not identifying as a 'Cell' It is identifying as a 'WebObject', as per swetha b its an webelemnt in her wetable? I think the question is to get the row where there is Green in a certain time period.. so you just need to identify the column first depending on the time period, then in that column check the color of webelements in each row, if it matches with your criteria check the checkbox in that row of your webtable. RE: Checkig color of an image??? - swetha.b - 01-04-2010 Hi saket, Thanks for your response. Now I could abe to get the color of a cell using the code you have given: Code: var = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebElement("WebTable").Object.currentStyle.backgroundColor Now the issue is : as baba mentioned (btw we are not same ![]() Issue is how do I select those columns : Please have a look at the attached screen shot which shows how the column names are divided and number of cols. Did I make sense ?? RE: Checkig color of an image??? - Saket - 01-05-2010 As I can see in the snapshot the columns does not include the subcolumns there which is 0,1,2,3,.. it is representing it as the main column which is Jan2010,.. I beleive all the webelements are in the columns, can you check it if you can get all the elements in a particular column lets say 7th column if you are getting this check each elements color in a cell, numerise it as per index (to identify the time period) and do the required. Let me know how it goes. RE: Checkig color of an image??? - swetha.b - 01-06-2010 Hi Saket Here I go , lot many questions and lot many doubts : Looking at your reply I have tried these combinations. But nothing seems to be working properly: 1) Using Child Object mthod: Code: Dim obj_checkDesc, allchkvalues, singlechkvalue 2) Using descriptive programming Code: i= 2 3) Getting Child Object Code: Dim obj_checkDesc, allchkvalues, singlechkvalue,objcolor Thanks Swetha RE: Checkig color of an image??? - Saket - 01-07-2010 Hi Swetha, Sorry for my ignorance if I didn't go through your scripts properly. I would like to suggest you a different approach here Code: ObjTable = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2") |