WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

How to find the Popup element in WPF?

Open DingpingZhang opened this issue 5 years ago • 3 comments

I have readed the issue #419 , but it don't work for me. I want to find a MenuItem element in a WPF program, and I get the XPath by the following two way. They provide different values, but they can NOT find the element.

  1. Inspect.exe: It thinks that MenuItem is an element on WPF Window. image

  2. WinAppDriverUiRecoder: It thinks that MenuItem is a Window (Popup) on root (Desktop). image

What's more, I found a horrible thing: the following two pieces of code differ only in one line (winElem1.Click()), however, using the same XPath and session, the elements obtained before and after the change are different. It looks like the winElem1.Click() emptied the entire desktop element!

image

==========================================
POST /session/BB5B35A6-1710-4BCF-9928-714445F8D861/elements HTTP/1.1
Accept: application/json, image/png
Content-Length: 31
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723

{"using":"xpath","value":"//*"}
HTTP/1.1 200 OK
Content-Length: 74
Content-Type: application/json

{"sessionId":"BB5B35A6-1710-4BCF-9928-714445F8D861","status":0,"value":[]}
==========================================

DingpingZhang avatar Jan 10 '19 12:01 DingpingZhang

Anyupdate on this.. Even im facing issues while handling popups...

rajivsai92 avatar Jan 31 '20 23:01 rajivsai92

Let me know the version of appium driver your using..

rajivsai92 avatar Feb 08 '20 19:02 rajivsai92

It seems to me that we don't have any possibility to get elements under the PopupRoot element in the WPF visual tree. Is that assumption correct? Background: How to work with Comboboxes / DropDownButtons with Flyout open?

Windows App Driver version 1.2.2009.2003 Appium.Webdriver Nuget 4.3.2

fondencn avatar Aug 10 '22 08:08 fondencn