how can we get color of the text from an silver light applic

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
sainath
Posts: 2
Joined: Thu Feb 12, 2015 3:03 pm

how can we get color of the text from an silver light applic

Post by sainath » Mon Feb 16, 2015 1:26 pm

Hello Support team,

I have a scenario where I need to get the color of the text from an silver light application. i have read previous posts and tried with get style and get attribute methods but I could not get the color of the text.

I would like to know is this possible through Ranorex if so, how?

Thanks,
Sainath

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

Re: how can we get color of the text from an silver light applic

Post by Support Team » Tue Feb 17, 2015 2:15 pm

Hi Sainath,

Ranorex uses accessibility (UI Automation) for testing of WPF and Silverlight applications. This accessibility (UI Automation) infrastructure unfortunately exposes only a subset of control properties which is limiting in some cases. When nonstandard attributes are used you therefore also need to expose them to UI Automation.
You may need to overwrite the IValueProvider for that element or simply bind the not identified attribute to one of the not used UI Automation attributes like the ItemStatus or the ItemType attribute.

So one workaround that is possible in this case is to use the ItemType property of UI Automation.
For example, in the below XAML snippet, just by adding the line in bold, the color of MyButton is exposed as ItemType and can be validate using Ranorex now:

Code: Select all

<Button
Name="btn" Background="Red"
AutomationProperties.ItemType="{Binding RelativeSource={RelativeSource Self}, Path=Background.Color}">
            MyButton</Button>
Regards,
Markus (S)
.
Image

sainath
Posts: 2
Joined: Thu Feb 12, 2015 3:03 pm

Re: how can we get color of the text from an silver light applic

Post by sainath » Fri Mar 27, 2015 1:12 pm

Hello Support Team,
I am very glad that your supporting me in all the difficulties I have faced while automating an application.
but, as you mentioned below I cannot get the code of the application and modify it. can you please guide me in such a way where I can use ranorex built in key words to get the text colour.


Thanks,
Sainath

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

Re: how can we get color of the text from an silver light applic

Post by Support Team » Tue Mar 31, 2015 1:12 pm

Hi Sainath,

Unfortunately I am afraid that you need to modify the source code of your application in order to get the text color of your desired element. Ranorex uses UI Automation in order to identify elements of a WPF application and this can be limiting in some cases since the UI Automation infrastructure only exposes a subset of predefined control properties and methods. Furthermore, it is also very likely that object identification issues are related to not correctly implemented UI Automation peers.

Thank you for your understanding.

Regards,
Markus (S)
.
Image