Hi Team,
we are using leapwork mobile automation and through that we tried to perform the swipe right operation on the WMA app
Steps to perform.
Open the app
click on demo mode
click on Purchase Receive, in this window we are performing swipe right .
Below is the code which we are using
var inputDevice = new PointerInputDevice(PointerKind.Touch, MobileConstants.SwipeTouch);
var swipeActionSequence = new ActionSequence(inputDevice, 0);
var swipeDuration = GetSwipeDuration();
var center = GetElementCenter();
executor.Log.Debug($“Element center calculated at ({center.X}, {center.Y}).”);
var destination = GetTouchDestination(center);
executor.Log.Debug($“Touch destination calculated at ({destination.X}, {destination.Y}).”);
//Creating swipe sequence
swipeActionSequence.AddAction(inputDevice.CreatePointerMove(CoordinateOrigin.Viewport, center.X, center.Y, TimeSpan.Zero));
swipeActionSequence.AddAction(inputDevice.CreatePointerDown(PointerButton.TouchContact));
swipeActionSequence.AddAction(inputDevice.CreatePause(TimeSpan.FromMilliseconds(MoveToDelayMilliseconds)));
swipeActionSequence.AddAction(inputDevice.CreatePointerMove(CoordinateOrigin.Viewport, destination.X, destination.Y, swipeDuration));
swipeActionSequence.AddAction(inputDevice.CreatePointerUp(PointerButton.TouchContact));
//Performing swipe action sequence
executor.Driver.PerformActions(new List { swipeActionSequence });
executor.Log.Debug(“Swipe actions performed successfully.”);
here for swipe, we tried to pass custom swipe value to 50, sometimes it works as expectd and sometimes it does not work.
Kindly assist me.
