Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to perform drag and drop in Appium ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 2.46k
    Comment on it

    Drag and drop functionality is a very important functionality and we can easily perform through Appium.

    DesiredCapabilities capabilites = new DesiredCapabilities();
    capabilites.setCapability("device", "Android");
    capabilites.setCapability("deviceName", "GT-7582");
    capabilites.setCapability("platformVersion", "4.4.3");
    capabilites.setCapability("platformName", "Android");
    capabilites.setCapability("appPackage", "");
    capabilites.setCapability("appActivity", "");
    driver = new AppiumDriver(new URL(""),capabilites);
    driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);
    List element = driver.findElements(""));
    new TouchAction((MobileDriver)driver).longPress(element.get(0)).moveTo(element.get(3)).release().perform();

    LongPress() method of TouchAction class perform the drag action on the web-element and then drop moveTo() method performs the drop functionality, release() method is to release the touch action. Perform() method is used to perfom the series of actions.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: