microsoft / WinAppDriver

Windows Application Driver
MIT License
3.65k stars 1.4k forks source link

I cannot find element in Main Window of WPF using any inspect tool #1757

Open shery-k opened 2 years ago

shery-k commented 2 years ago

I have a desktop app with only one main window implemented in WPF . it is an area in main window( included search textbox that i am trying to find element for automation). this element comes from another view model binded to the main view model. i am using winapp driver framework, and code in C# please note in binded xmal file i can see AutoamtionID but inspect tools ( inspect.exe, UI recorder, Accessibility tool) cannot find element at all. what should i do? thanks below snippet showing how addressed in main window xaml file: `<TabItem x:Uid="TabItem_1" Header="MyTab" AutomationProperties.HelpText="Tab for accessing workflow" AutomationProperties.AutomationId="tab1">

        </TabItem>`

from UI Recorder: Xpath "/Pane[@ClassName=\"#32769\"][@Name=\"Desktop 1\"]/Window[@Name=\"Main Window\"][starts-with(@AutomationId,\"wpftheme:ThemeWindow\")]/Tab[starts-with(@AutomationId,\"TabControl\")]" Note: no matter on what element i clicked i got the above xpath

anunay1 commented 2 years ago

Which windows OS are you using? Are you using inspect.exe from Windows SDK?