HI, I Tried to perform a swipe with this method. I don't have error message in Appium but it doesn't work.
I use this code to initialize the driver:
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.io.File;
public class Application {
private final static String APPIUM_PORT = "4723";
private final static String APPIUM_HOST = "127.0.0.1";
public static AppiumDriver driver;
capabilities.setCapability("platformName", "iOS");
…
setDriver(new IOSDriver(new URL("http://" + appiumHost + ":" + appiumPort + "/wd/hub"), capabilities));
}
... and this code to perform the swipe:
public static void testSwipe(){
MobileElement element = (MobileElement) driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAStaticText[2]"));
element.click(); // OK
element.swipe(SwipeElementDirection.LEFT, 1000); // Test Swipe #1 : KO
driver.swipe(300, 400, 10, 400, 500); // Test Swipe #2 : KO
}