WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

WinAppDriver stimulate KeyUp extremely slowly

Open khoachung89 opened this issue 7 years ago • 0 comments

After I stimulate about 100 drag and drop actions on my window, WinAppDriver performs slowly on actions that has modifier keys (Ctrl, Shift, Alt...). I create my session normally like: var option = new AppiumOptions(); option.AddAdditionalCapability("app", @".....\MyApp.exe"); var session = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), option); session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1.5); session.SwitchTo().Window(session.WindowHandles[0]);

Do something like: Send a key down: var action = new Actions(session); action.KeyDown(Keys.Control); action.Perform();

and do some actions: for(var i =0;i<100;i++){ var x1 = rand.Next(300, 500); var y1 = rand.Next(300, 500); var x2 = rand.Next(300, 500); var y2 = rand.Next(300, 500); Actions moveActions = new Actions(session); moveActions.MoveToElement(myElement, x1, y1); moveActions.ClickAndHold(); moveActions.MoveByOffset(x2 - x1, y2 - y1); moveActions.Release(); moveActions.Build(); moveActions.Perform(); }

At last, I send the modifier key: action = new Actions(session); action.KeyUp(Keys.Control); action.Perform();

The last action is performed extremely slow. I can see on the command screen of WinAppDriver, it take minutes to complete this single action. image

khoachung89 avatar Sep 21 '19 07:09 khoachung89