How to set focus on a control with Appium in Windows (WPF, Desktop)?

328 Views Asked by At

I'm automating a WPF desktop app in Windows. We're currently switching from CodedUI to Appium, as the former is deprecated.

I'm trying to click a control that is currently not visible, as it requires the user to scroll down. It's worth noting that, for some reason, when inspecting the control (via Inspect.exe tool), its Displayed property == True and isOffscreen == False.

With CodedUI I can simply invoke EnsureClickable() and it will automatically scroll to the control, if necessary.

In Appium there seems to be no straightforward way to do it. I can't find any way to set focus on a control. I tried invoking new Actions(driver).MoveToElement(element) but that only produced

OpenQA.Selenium.WebDriverException: Currently only pen and touch pointer input source types are supported

Any ideas?

0

There are 0 best solutions below