teststack

TestStack | How to find custom controls and invoke methods / fire events

两盒软妹~` 提交于 2020-01-11 13:55:09
问题 I have a custom Control HtButton which inherits from Control . I made a custom FrameworkElementAutomationPeer and override the OnCreateAutomationPeer() in HtButton . public class HtButtonAutomationPeer : FrameworkElementAutomationPeer { public HtButtonAutomationPeer([NotNull] FrameworkElement owner) : base(owner) { } protected override string GetClassNameCore() { return "HtButton"; } } public abstract class HtButtonBase : Control { } public class HtButton : HtButtonBase { protected override