Appium XPath locator strategy is not supported

I am setting up to run my automated Windwos app tests in a new VM (Windows 11). They have been running green for months in another VM (Windows 10), but in the new VM, I’m getting an error xpath locator strategy not supported , when using FindElements() .

The output from Appium server can be seen in the attached image.

My locator is: By.XPath(".//*[@AutomationId='" + automationId + "']") , where automationId="MainWindow" .

Again, this works perfectly fine on my local PC and my old VM.

I am using Appium 2.x, Appium.WebDriver 4.4.5 (also tested with 5 rc2), and have the Windows driver installed. I have tried with having the appium server running (though I’ve read it’s only supported on Win 10) and having winappdriver running. I’ve also tried to downgrade to Appium 1.22.3, but the error persists.

If I change it to search via By.ClassName , then it works, so for some reason it really has a problem with By.XPath .

The difference to other similar questions is that there is nothing wrong with the XPath I provide.

I also raised this topic on StackOverflow

Update: I tried to execute the tests in a local PC I have which we upgraded to Windows 11, and there it works, but I need to have it working in my VM as well.

Solved by updating the WinAppDriver version