Mouse Double-click
In some cases is useful to do double-click on a application and there is no method to do it.
I've tried do two times the Click() but it takes to long and the system does not understand as double-click.
Hi @FBorges14,
Double click mouse action is obviously useful and we have a proper example on how to do this on https://github.com/Microsoft/WinAppDriver/blob/v1.0/Tests/WebDriverAPI/Mouse.cs#L94. E.g.
session.Mouse.MouseMove(appNameTitle.Coordinates);
session.Mouse.DoubleClick(null); // Pass null as this command omit the given parameter
We can use below code for double click on any element:
Actions action = new Actions(driver);
action.MoveToElement(ContactFromList).Click().DoubleClick().Build().Perform();
Perform a click() before DoubleClick() is for safe site. Application may need a click before double click otherwise you can skip it.
It is more convenient to write an extension method,
internal static class Helper
{
public static void DoubleClick(this WindowsElement element)
{
new Actions(element.WrappedDriver)
.MoveToElement(element)
.Click()
.DoubleClick()
.Build()
.Perform();
}
}