How to test the color of a cell in Ranorex ?

Ask general questions here.
anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

How to test the color of a cell in Ranorex ?

Post by anouar2002 » Tue Oct 19, 2021 5:25 pm

Hello Ranorexers,

I am using Ranorex 9.3.4 version, and I want to test the color of a cell in a table (WinForms Application). So, I used "validate" to check the color.

I don't find any attribute to check the color. I searched for that in the documentation and I find this video: https://www.youtube.com/watch?v=SEUG3Jq ... el=Ranorex

The problem that I don't have the "BackColor" attribute in the validation settings. How to add it ? or how to test the color of a cell ?

THanks in advance!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to test the color of a cell in Ranorex ?

Post by odklizec » Tue Oct 19, 2021 7:57 pm

Hi,

I’m afraid, it’s impossible to suggest something reliable without seeing, at very least, Ranorex snapshot of the app under test. But in this particular case, I think a small sample app featuring the table in question, would be required too. Please check this post, which may help also with your problem… viewtopic.php?f=4&t=6869&p=28331#p28331
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

Re: How to test the color of a cell in Ranorex ?

Post by anouar2002 » Wed Oct 20, 2021 8:02 am

Hi odklizec,

Thanks for trying to help me.
I don't think that a snapshot is necessary in this case. All what I ask about it "Where is the BackColor in Validation Settings ?" as shown in the documentation:

https://imgur.com/a/WJL0ALr

And this is what is shown in my validation settings:

https://imgur.com/a/Xpj7pdn

You can see that there are many missing attributs as BackColor.

By the way, this a screenshot of what I want to test:

https://imgur.com/a/wE2pbBr

From the screenshot, you can see that I have different colors. My task is to check that the cell which contain "subT" should have the color purple.

Thanks in adavance,
Anouar

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to test the color of a cell in Ranorex ?

Post by odklizec » Thu Oct 21, 2021 7:39 am

Hi,

I totally understand what you want. The thing is, that without the snapshot or rather a working sample app, there is not much anyone here can do or suggest ;) If you check my previous post, there is a link to a post with descritption and sample code, how to get background color from a WinForm cell, even though the background color is not listed in Spy. And you can find other samples by searching the forum. Sadly, without the sample app, it's only a guess work and you will have to try it yourself.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

Re: How to test the color of a cell in Ranorex ?

Post by anouar2002 » Thu Oct 21, 2021 12:04 pm

Hi Pavel,

Thanks for the reply.

I will try with the code, but I am not sure if this will resolve the problem. A snapshot can I provide it if it is needed.

Thanks,
Anouar

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to test the color of a cell in Ranorex ?

Post by odklizec » Thu Oct 21, 2021 1:17 pm

Hi,

I believe that snapshot will be not very useful this time. If Spy does not show the BG color anywhere in available attributes, you will have to try it with real app. The code from provided link could help.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration