Forum Discussion

rmishra's avatar
rmishra
Contributor
13 years ago

Capturing color codes used in Application site while testing

Hi

For my application site, i need to identify the colors in the site. I am using TestComplete Version 7.5. Using Object property , at soem controls or tabs in screen , tool is able to identify the color code using "bgcolor" property , but usually the bgcolor property is blank at scenarios where color coding is used. is there a way out where from we can identify / capture color codes of boxes, controls, text boxes in the site using Test Complete


4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I could be wrong... but if a component, like a cell, does not have a specific bgcolor (Background color) defined, doesn't it just take the bgcolor from the parent object or from some other reference in the CSS for the page?  For example, if my web page has a default color as the background color and I don't designate an over-ride for the cell, doesn't the cell show the page color?  Or, for that matter, if the page has one color but the table has another, the cell, since it's a child of the table, will have the table's color?  The only time, I think (and again, I may be mistaken in this), that a cell like you've shown will have a specific background color is if it has that color specifically designated to it in the code, otherwise, it uses the bgcolor of the table.
  • i have attached a snapshot of the scenario of bg color..., how do i capture this color
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Again... the problem may be that the tab itself doesn't have a bgcolor but the bgcolor is inherited from some other class or parent or something.  Without knowing more about the architecture behind the scenes, I can't really give any more specific answers.



    Something you might want to try is try using a region comparison to compare color to color to see if it's the correct color.
  • Hi,



    Also, how is the color set on your site for the object for which it is displayed and for the one for which it is not displayed? Perhaps, there's a way to get it from some other object.



    As for region checkpoints Robert suggested, you can also just capture an image of your object and access one of its pixels via its Pixels property. You'll get the color encoded in the same way as if you used bgcolor to get it.