I am using Appium and the Appium Windows Driver to automate GUI-Tests of WPF-applications. Finding and working with elements found by the Id-selector for instance works fine.
What I am right now trying to achieve is to find elements by using xpath and the xpath-selector. This works fine for “simple” windows application, such as the Windows Calculator but it seems to fail when applying it to my target application, which has a more complex GUI.
Within the simple text editor baretail.exe (for instance) I am using
"/Window/MenuBar/MenueItem" as xpath-string within the Appium-SessionManager to search for an element. This works fine. Also, called from within source code by stating
var result = session.FindElementsByXPath("/Window/MenuBar/MenueItem")
returns the correct element.
However, when I am applying the same procedure to get elements from my target application, appium seems to be unable to find any element. It keeps feedbacking me that no elements were found.
Not even, when I am using simple xpath-strings such as
"/Window" or “//*”.
One more thing I noted is that when I am comparing the suggested xpath-string the Appium SessionManager shows me and the path in the element-tree shown by microsofts inspect.exe tool to the same element, I see the following syntactic difference w.r.t. the names (casing and spacing):
- Suggested by Appium-Session-Manager: "/Window/MenuBar/MenueItem"
- Shown as tree path within inspect.exe: “window” -> “menu bar” -> "menu item"
Can anybody provide me any tipps or suggestions why xpath works in one application but totally fails in another?
Since I am working on a time-critical project I am more than grateful for any help! Regards.