microsoft / WinAppDriver

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

SendKeys do not work on specific computer? #1795

Open Pulseweaver opened 2 years ago

Pulseweaver commented 2 years ago

Hi,

We got 5 computers with Windows 10 and Visual Studio 2022 running a UITest with WinAppDriver. All of them works fine but 1 where SendKeys do not. We can see that the Textbox controls is selected and cleared but nothing is filled in?

WinAppDriver starts and closes the winform client that we test and it is executed locally only.

Visual studio 2022 and WinAppDriver is running as administrator, what else could block SendKey?

Regards

anunay1 commented 2 years ago

Have you checked the keyboard configuration in that system. Also which language bindings are you using.

Pulseweaver commented 2 years ago

Then this might be due to TeamViewer to remote the dev environment, suspect that this will change the keyboard configuration. I will try to run the test without TeamViewer.

Im using .NET 6.0 with C#.

anunay1 commented 2 years ago

Sendkeys has issues. It does not get disposed even after driver.quit(). I have created a custom method using System.Windows.Forms and using the clipboard class which will emulate copy and paste, please let me know if you require.

liljohnak commented 2 years ago

We're using this keyboard library. https://github.com/charygao/MouseKeyboardLibrary/

Pulseweaver commented 1 year ago

Tried to run the test right on the computer instead for with TeamViewer and this solved the problem. So TeamViewer use another keyboard that do not work well with WinAppDriver.