Ask a Question

Get Color of an object (python)

SOLVED
IuliaVascan
Occasional Contributor

Get Color of an object (python)

Hi,

I have the object from the below pictures with the object browser methods (.NET) from the third picture. This object is changing its color from green to grey, it's the same object but with different colors. How can I get the color of the object? 

I tried to use Aliases.SoSwEETApplication.MainForm.guiObj.Battery.bt_grey.get_BackColor but it's not working.

 

I also find https://smartbear-cc.force.com/portal/KbArticleViewer?name=Get-a-control-s-background-color&sp=testc... this article, do you know if this is also in a python version?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Get Color of an object (python)

Hi,

 

object browser methods (.NET)

As this is .Net application, the chances are high that control provides some property/method that returns control's background color. Talk to developers or read control's documentation.

 

but it's not working.

From its name, get_BackColor() seems to be a relevant method. What have you tried? What exactly was not working?

 

do you know if this is also in a python version?

I do not use Python thus I don't have Python version of the referenced code, but I believe that migration from JScript to Python should not be too complex.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

2 REPLIES 2
sonya_m
Community Manager

Re: Get Color of an object (python)

Thank you for your question, let's see if we can have help from the Community!

 

@tphillips @AlexKaras @A_Roskoshnyi any suggestions?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
AlexKaras
Community Hero

Re: Get Color of an object (python)

Hi,

 

object browser methods (.NET)

As this is .Net application, the chances are high that control provides some property/method that returns control's background color. Talk to developers or read control's documentation.

 

but it's not working.

From its name, get_BackColor() seems to be a relevant method. What have you tried? What exactly was not working?

 

do you know if this is also in a python version?

I do not use Python thus I don't have Python version of the referenced code, but I believe that migration from JScript to Python should not be too complex.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: