how to add unsupported Patterns to an AutomationElement? do AutomationPeers change the application under test?

StackOverflow https://stackoverflow.com/questions/23547085

  •  18-07-2023
  •  | 
  •  

سؤال

the following custom control ToggleButton is not capable of InvokePattern.

<ToggleButton   Click="click_event" 
... />

What can I do to execute the ToggleButton's click-event over some UIA-Pattern??


This link provides information about AutomationPeer & custom controls. But it seems like I need to change the application under test (AUT) to use this customized AutomationPeer?! Guideline if you are allowed to change the AUT

هل كانت مفيدة؟

المحلول

Toggle buttons don't support InvokePattern, but they do support TogglePattern. You shouldn't need to dive into the automation peers at all.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top