Forum Discussion

mercyadewoye's avatar
Occasional Contributor
3 years ago

How to get color of a specific area of a grid

Hi there,

I am trying to detect the background color in a small area of a grid based on specific action(s) carried out. Bearing in mind I do not have intelligent quality add-on to be able to zone in on a required segment per time, the only option I have thought about using is to take a picture of the segment and store it and use regions.check to check for a match. However, I realized the regions only stores the image and I am wondering how I can detect the background colour of the image stored so as to detect the current color. Can anyone who has experience doing this pls advise how they went about this?



2 Replies

  • since this is a desktop applicaiton, the only way you're getting the color of that object is if the color is exposed as a property. 

    take the object spy, grab that grid where you'd like to see if color is available,

    view advanced properties (so that you can see the whole list) and scroll through to see if there is something you can use

    • mercyadewoye's avatar
      Occasional Contributor

      Hi Kim, 

      I see a get_backcolor property however, I'm not sure how to use it since I am not able to narrow down the grid to select the portion I am interested in. Test complete can only detect the whole grid and it will be confusing to have to output the color in the whole grid. See image below