DEV Community 👩‍💻👨‍💻

Cover image for Swipe objects in Appium with C#

Posted on

Swipe objects in Appium with C#

Simple function for swiping object 1 to object 2 in Appium using C#

Swipe objects in appium using W3C standards in C#

/// this code works Following the W3C standards

using System.Threading;
using OpenQA.Selenium.Appium.MultiTouch;

float object1CoordinateX = 500;
float object1CoordinateY = 500;
float object2CoordinateX = 500;
float object2CoordinateY = 1000;

TouchAction actionOne = new TouchAction((OpenQA.Selenium.Appium.Interfaces.IPerformsTouchActions)TestData.driver);
actionOne.Press(object1CoordinateX, object1CoordinateY);
actionOne.MoveTo(object2CoordinateX, object2CoordinateY);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

18 Useful Github Repositories Every Developer Should Bookmark

18 Useful GitHub repositories every developer should bookmark: everything from learning resources and roadmaps to best practices, system designs, and tools.