microsoft / WinAppDriver

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

FindElementByXpath on Chromium framework Apps #1719

Open kuozheyu opened 2 years ago

kuozheyu commented 2 years ago

I tried to use xpath that got from UIrecorder to get element by call FindElementByXpath ,but it's not work on Chromium framework Apps . WinAppDriver show element not found. Then I found the UIrecorder element's xpath is not same as the xpath that WinAppDriver used to find element . In some cases, "/group/" in xpath need to be removed.

Is there any way to find the correct xpath on Chromium framework Apps ? Or, Are there fixed rules from UIrecorder xpath to WinAppDriver xpath ?

anunay1 commented 2 years ago

check this https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver

anunay1 commented 2 years ago

Also check #1668

kuozheyu commented 2 years ago

check this https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver

This method seems like for web automation, but I work on Apps that is Chrome Framework (e.g. Skype, Teams) . Does this solution work in my case? Also, I want to automate them in desktop session. I saw most of functions provided by WinAppDriver work fine on Chrome Framework App , and Win32 IUIAutomation supposed to support Chrome Framework , So, I think the error should be in xpath .