public static void DoubleTap(UIObject obj, double offsetX, double offsetY) { try { Log.Comment("Double-tap on {0} at ({1}, {2}).", obj.GetIdentifier(), offsetX, offsetY); using (var waiter = GetWaiterForInputEvent(obj, InputEvent.Tap)) { if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) { Log.Warning("Touch input is not available on OS versions less than RS5. Falling back to mouse input."); obj.DoubleClick(PointerButtons.Primary, offsetX, offsetY); } else { obj.DoubleTap(offsetX, offsetY); } } } catch (Exception e) { Log.Warning("Exception while double-tapping: " + e.Message); } Wait.ForIdle(); }
internal static ResponseStatus SendTouchTypeClick( string touchType, UIObject clickElement) { var responseStatus = ResponseStatus.UnknownError; if (!(touchType == "click")) { if (!(touchType == "doubleclick")) { if (touchType == "longclick") { clickElement.TapAndHold(); responseStatus = ResponseStatus.Success; } } else { clickElement.DoubleTap(); responseStatus = ResponseStatus.Success; } } else { clickElement.Tap(); responseStatus = ResponseStatus.Success; } return(responseStatus); }