WPF, White and Infragistics Project

I am trying to use Project White to write automated tests for my WPF application. Everything is going well until I try to interact with the Infragistics controls. Has anyone had any experience with this setting and could you post an example of how I can (for example) interact with XamRibbon or XamOutlookBar?

+3
source share
1 answer

A bit of a general answer that I'm afraid of, but if White doesn't help you, you can directly use Microsoft UI Automation.

Find your control first. If he received WPF "Name", then he probably has an automation identifier that matches the name:

AutomationElement element = AutomationElement.Root.FindFirst(
    TreeScope.Descendants,
    new PropertyCondition(AutomationElement.AutomationIdProperty, <whatever>))

Alternatively, you can use things like NameProperty, which are mostly mapped to text or captions, or to ControlTypeProperty or ClassProperty. You can always use FindAll to provide you with more information about the available controls.

When you find your control, print out its supported templates and properties:

element.GetSupportedPatterns()
element.GetSupportedProperties()

. , ListItemPattern, GridPattern . , , . , , . :

((TogglePattern)Element.GetCurrentPattern(TogglePattern.Pattern)).Toggle()

Snoop - , , : http://snoopwpf.codeplex.com/

+2

Source: https://habr.com/ru/post/1747345/


All Articles