microsoft / WinAppDriver

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

KeyBoard action instance not disposed, using Action Builder after WinAppDriver upgraded to 4.1.1 #1101

Open dartime333 opened 4 years ago

dartime333 commented 4 years ago

Hi,

Recently we upgraded Appium.WebDriver from 3.0.0.2 to 4.1.1 for wpf application automation, we have scripts using Action Builder used for keyboard operation like Control + A, Control + C but found some unusual behavior after these related scripts executed in latest WinAppDriver (4.1.1).

Few other lib's upgraded along with Appium WebDriver: Selenium.Support, Selenium.WebDriver: 3.0.1 to 3.141.0 Castle.Core: 3.3.3 to 4.4.0

The keyboard instance is not getting disposed, ie., consider if your recent test script performed key board control action which works perfectly fine. But once this test script is completed, we see that key board control instance still exists, just try to scroll mouse up and down, you can see zoom-in and zoom-out of the desktop items, else just press Esc button Windows menu list will display. And you can still try other keyboard with control actions.

We did tried to dispose Action builder instance but still above mentioned issue was not solved.

Please let us know how do we need to handle to dispose Keyboard action using Action Builder.

Action Builder snippet:
_Actions builder = new Actions(windowsdriver); builder.KeyDown(Keys.Control); builder.SendKeys(Keys.ArrowUp); builder.KeyUp(Keys.Control); builder.Perform();

Note:

  1. Changes taken care: AppiumOptions instead of DesiredCapabilities
  2. Changes taken care: ImplicitWait instead of ImplicitlyWait
anunay1 commented 3 years ago

Even I am facing the same issue, Were you able to solve this. Any help into this will be highly appreciated.

anunay1 commented 3 years ago

@kat-y Can This be taken on priority?

anunay1 commented 3 years ago

And this happens with 3.0.0.2 also.

kavyashreer23 commented 3 years ago

We are facing the same issue. Probably that is the reason, the value being entered into TextBox is $)))! where it is supposed to enter 40001. This issue happens randomly

This is the code where Shift Key is used: var action = new Actions(ApplicationSession); action.KeyDown(Keys.Shift); element.Click();
action.KeyUp(Keys.Shift); // This does not work hence we are using Action release to release SHIFT key action.build().Perform(); action.Release().Perform();