TestStack / White

DEPRECATED - no longer actively maintained
Other
1.02k stars 486 forks source link

Hold a button for seconds #639

Closed PatrickTreutlerD closed 5 years ago

PatrickTreutlerD commented 5 years ago

I miss the function to press a button for a definable time. The test should not wait for it, it should be possible to assert something during the time runs.

This is not an issue, more a suggestion for an additional function or the hope to get a hint how this can get reached with the actual, available functions. Teststack White is a very helpful test-framework for me anyway.

PatrickTreutlerD commented 5 years ago

Issue #321 brought me to the aim. I used the wrong object. The teststack-white-mouse-object offers the required functions left/right mouse button down/up.

var button = container.Get<Button>(SearchCriteria.ByAutomationId("buttonId")); var mouse = MainWindow.Mouse; mouse.Location = button.Bounds.Center(); //mouse.Click(); Mouse.LeftDown(); await Task.Delay(1000); // [ms] Mouse.LeftUp();