Page 1 of 1

WPF style properties?

Posted: Fri Dec 07, 2012 11:15 am
by lustuyck
Hi,

we can successfully use Ranorex to test our WPF application. However, it is unclear to us how we can test styles. If validation errors are shown in the form, an exclamation mark is put next to the control and a red border appears around the control.

How can we use Ranorex to test that this style is actually applied to the controls in case of a validation error? Style does not seem to appear in the properties of a control.

Thanks,
L

Re: WPF style properties?

Posted: Fri Dec 07, 2012 1:02 pm
by Support Team
Hi,

Could you post us two Ranorex Snapshot files of the control, one when there is the exclamation mark and the red border and one when there is no mark, this will help us to find a solution for this issue.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.

Thanks,
Markus

Re: WPF style properties?

Posted: Mon Dec 10, 2012 9:17 am
by lustuyck
Hi,

thank you for the answer. I added the snapshots and an image of the window in a zip file (attachment). before.rxsnp is the window before validation, after.rxsnp is the window after validation, screenshot.png is the window that shows the validation indications.

Thanks for the help!

Re: WPF style properties?

Posted: Mon Dec 10, 2012 4:42 pm
by lustuyck
Additional information: it seems I would have to be able to get the control template of a control, to get the Border element and check the color of it. Is this possible?

Re: WPF style properties?

Posted: Tue Dec 11, 2012 3:18 pm
by Support Team
Hello,

Thank you for the snapshot files.
I checked the files and was not able to find a property which can be used to distinguish if there is a red border around the control or not. You could try to set a property, e.g. 'AccessibleDescription' in your application which can be accessed by Ranorex to test this behavior.

Ragards,
Bernhard