Way to get the color property of Flex Element

Ask general questions here.
rahul.bansal
Posts: 3
Joined: Mon Dec 06, 2010 4:22 pm

Way to get the color property of Flex Element

Post by rahul.bansal » Wed Dec 08, 2010 12:10 am

Hello

I am trying to check the color property of a FlexElement and I am not sure how to do this. Is there a way to get the color property of an element. I have also tried to use Ranorex Spy to see if there is an explicit property (of the Element I am trying to work with) which deals with the color, but no help. Any ideas?

Thanks for the help

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Way to get the color property of Flex Element

Post by Support Team » Wed Dec 08, 2010 5:09 pm

Hi,

Please take a look to following post. Maybe the code sample in it solves your problem to get the color of your element. http://www.ranorex.com/forum/flexelemen ... t1734.html

Another solution would be to write the color to an property which is visible for Ranorex out of the box, for example description. Then you can use the RxPath to get the color of your element.

Regards,
Peter
Ranorex Team
.
Image

rahul.bansal
Posts: 3
Joined: Mon Dec 06, 2010 4:22 pm

Re: Way to get the color property of Flex Element

Post by rahul.bansal » Thu Dec 09, 2010 11:11 pm

Thanks for the reply Peter, the post was helpful. I had another question about the color property which I wasn't able to get an answer for from the previous post.
In my application, I have a LinkButton which I am converting into a FlexElement using the repository path. What I would like to do is get the color of the font and check this value against my desired value. When I do GetStyle("color") on this button, I do not get the right color value. I have tried doing GetStyle("font-color")/ GetStyle("fontcolor") but no help. Could you tell me if there is a way to get the proper font color of a FlexElement? Does GetStyle("color") work differently on LinkButton Flex Elements?

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Way to get the color property of Flex Element

Post by Support Team » Fri Dec 10, 2010 1:19 pm

Hi,

the GetStyle method provided by Ranorex directly accesses the Flex object. So it should be possible to get all style elements provided by the Flex element thru this method.
So please find out how exactly the property you want to get can be accessed.

Kind regards,
Tobias
Support Team
.
Image