# Swipe broken on 1.3.3? ios 8.1

**URL:** <https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688>\
**Category:** Support\
**Created:** [November 26, 2014, 11:27pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688 "2014-11-26T23:27:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [November 26, 2014, 11:27pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/1 "2014-11-26T23:27:33Z")

</div>

updated to 1.3.3 this piece of code is broken now.

```
public static void swipeForward(WebDriver mDriver)
{  
    JavascriptExecutor js = (JavascriptExecutor) mDriver;
    HashMap<String, Double> swipeObject = new HashMap<String, Double>();
    swipeObject.put("startX", 0.95);
    swipeObject.put("startY", 0.5);
    swipeObject.put("endX", 0.05);
    swipeObject.put("endY", 0.5);
    swipeObject.put("duration", 1.8);
    js.executeScript("mobile: swipe", swipeObject);
}

```

trace:

```
org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 7 milliseconds
Build info: version: '2.42.2', revision: '6a6995d31c7c56c340d6f45a76976d43506cd6cc', time: '2014-06-03 10:52:47'
System info: host: 'MTVL11fe50b4f', ip: '172.28.22.100', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.1', java.version: '1.7.0_45'
Session ID: e386e8f1-e55d-4b5c-9b6c-cc79e48067bb
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{newCommandTimeout=600, platformVersion=8.1, app=/Users/me/Desktop/appium/myapp.app, platform=MAC, databaseEnabled=false, javascriptEnabled=true, deviceName=iPhone 6 Plus, platformName=ios, browserName=, webStorageEnabled=false, networkConnectionEnabled=false, desired={newCommandTimeout=600, platformVersion=8.1, app=/Users/me/Desktop/appium/myapp.app, platformName=ios, deviceName=iPhone 6 Plus, browserName=}, locationContextEnabled=false, warnings={}, takesScreenshot=true}]
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
  at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
  at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:508)
  at com.xxx.xxx.swipeForward(Test.java:375)
  ...

```

go back to 1.3.1, everything is working again?  
Am I doing anything wrong?

---

<div class="post-metadata">

**Author:** ![gandalf44](https://discuss.appium.io/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@gandalf44](https://discuss.appium.io/u/gandalf44)\
**Post date:** [December 1, 2014, 2:54pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/2 "2014-12-01T14:54:33Z")

</div>

Also, the Appium.app Inspector ‘Swipe’ functionality is also not working with 1.3.3. It worked fine with 1.3.1.

---

<div class="post-metadata">

**Author:** ![gandalf44](https://discuss.appium.io/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@gandalf44](https://discuss.appium.io/u/gandalf44)\
**Post date:** [December 1, 2014, 3:05pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/3 "2014-12-01T15:05:17Z")

</div>

I just re-verified that swipe is working fine in the Inspector and with the “mobile: swipe…” code on 1.3.1, so it’s something on 1.3.3 for sure.

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 1, 2014, 6:10pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/4 "2014-12-01T18:10:50Z")

</div>

people are reporting the same thing on github Appium issues.

> <https://github.com/appium/appium/issues/4199>
>
> After updating to Appium 1.3.3 the following code 
> 
> \`\`\`
> HashMap\<String, Integer…\> scrollUpObject = new HashMap\<String, Integer\>();
> scrollUpObject.put("touchCount", 1);
> scrollUpObject.put("startX", 150);
> scrollUpObject.put("startY", 800);
> scrollUpObject.put("endY", 200);
> js.executeScript("mobile: swipe", scrollObject);
> \`\`\`
> 
> is not working anymore and returns 
> org.openqa.selenium.WebDriverException: Not yet implemented.
> 
> Everything works fine in Appium 1.3.1. Can somebody give a solution for that, maybe another way to swipe if this is not longer supported in 1.3.3

---

<div class="post-metadata">

**Author:** ![jonahss](https://discuss.appium.io/user_avatar/discuss.appium.io/jonahss/32/5340_2.png) [@jonahss](https://discuss.appium.io/u/jonahss)\
**Post date:** [December 1, 2014, 6:35pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/5 "2014-12-01T18:35:32Z")

</div>

Gave you tried using the “swipe” TouchActions methods, instead of using “mobile: swipe” javascript executors?

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 2, 2014, 12:11am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/6 "2014-12-02T00:11:14Z")

</div>

I haven’t. It is something new to me.  
I have been using “mobile: swipe” for a while.  
I will try.

---

<div class="post-metadata">

**Author:** ![menypeled](https://discuss.appium.io/user_avatar/discuss.appium.io/menypeled/32/97_2.png) [@menypeled](https://discuss.appium.io/u/menypeled)\
**Post date:** [December 2, 2014, 5:50pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/7 "2014-12-02T17:50:03Z")

</div>

Hi fangmobile,  
doesn’t the driver.swipe() method works for you?  
it works on my iPhone5 however i don’t know how to swipe on the simulator any idea?

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 2, 2014, 6:31pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/8 "2014-12-02T18:31:44Z")

</div>

driver.swipe() has been broken for me for a while that is when I switched to mobile:swipe javascript.

If if does not work for you then try the Touchaction suggested by Jonah.

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 2, 2014, 7:56pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/9 "2014-12-02T19:56:28Z")

</div>

does anyone know whether driver.swipe() is working for java client?

---

<div class="post-metadata">

**Author:** ![menypeled](https://discuss.appium.io/user_avatar/discuss.appium.io/menypeled/32/97_2.png) [@menypeled](https://discuss.appium.io/u/menypeled)\
**Post date:** [December 2, 2014, 8:09pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/10 "2014-12-02T20:09:11Z")

</div>

Hi jonahss,  
can you PLS elaborate how to use the TouchActions class for Swipe?  
The driver.swipe() works great on devices however seems broken for simulator.  
Thanks…

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 2, 2014, 9:23pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/11 "2014-12-02T21:23:43Z")

</div>

@menypeled  
you can find usage of TouchAction in the client code, for java:

> <https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/TouchAction.java>

But I am having trouble make it work. There is no action, test passes, but it did not do the swipe…

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 2, 2014, 11:11pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/12 "2014-12-02T23:11:34Z")

</div>

somehow it works when I do swipe left.

```
mDriver.swipe(screenWidth-100, screenHeight/2, 50, screenHeight/2, 1800);

```

but does not work when I try to swipe up, either using TouchAction or driver.swipe().

```
mDriver.swipe(screen Width/2, screenHeight-100, screenWidth/2, 200, 1800);

```

or

```
action.press(200, 600).waitAction(2000).moveTo(200, 180).release().perform();

```

screenWidth is 414 and screenHeight is 736.  
It does not show error or exception, but does not do anything either.  
@jonahss Am I doing something wrong for the swipe up case?

Also noticed driver.swipe() is just implemented by TouchAction, so if action.press().waitAction.moveTo().release().perform() does not work then swipe won’t work.

What puzzles me is: why swipe left work but swipe up does not?

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 3, 2014, 2:42am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/13 "2014-12-03T02:42:35Z")

</div>

confirming swiping down also work but no swiping up.  
Using the TestApp and SimpleTest.java in Appium sample code repo, just add one test to swipe on the map view down and up for three times:

```
@Test
  public void testSwipe() throws Exception {
    final WebElement button = driver.findElement(By.name("Test Gesture"));
    button.click();
    final Alert alert = driver.switchTo().alert();
    alert.accept();
    driver.swipe(200, 400, 200, 200, 1000);
    driver.swipe(200, 200, 200, 400, 1000);
    driver.swipe(200, 400, 200, 200, 1000);
    driver.swipe(200, 200, 200, 400, 1000);
    driver.swipe(200, 400, 200, 200, 1000);
    driver.swipe(200, 200, 200, 400, 1000);
  }

```

You can see the map is swiped down three times but never swiped up.  
Then I thought SimpleTest.java might be outdated so I clone the java client repo and paste above test into

```
/java-client/src/test/java/io/appium/java_client/ios/iOSGestureTest.java

```

And I saw the same behavior.

---

<div class="post-metadata">

**Author:** ![menypeled](https://discuss.appium.io/user_avatar/discuss.appium.io/menypeled/32/97_2.png) [@menypeled](https://discuss.appium.io/u/menypeled)\
**Post date:** [December 3, 2014, 6:41pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/14 "2014-12-03T18:41:40Z")

</div>

I have looked & tried to use the various TouchAction’s methods but there is no swipe ability as far as i can see.  
Sounds very weird that Appium developers can’t swipe on simulator on the latest ios 8.x & latest appium client libraries…

---

<div class="post-metadata">

**Author:** ![gandalf44](https://discuss.appium.io/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@gandalf44](https://discuss.appium.io/u/gandalf44)\
**Post date:** [December 4, 2014, 2:43am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/15 "2014-12-04T02:43:19Z")

</div>

On @menypeled point, at least on 1.3.1 (I haven’t tried going to 1.3.4 yet) I am not seeing a “swipe” method appear. So, I looked at the TouchAction class to see how “swipe” is supposed to be implemented, and just used a press.wait.move\_to.release.perform

So I had this:

```
     self.driver.execute_script("mobile: swipe", {"touchCount": 1, "startX": 312, "startY": 374, "endX": 69, "endY": 379, "duration": 0.6241016})

```

* * *

Now I have this, and it works with TouchAction

```
    action = TouchAction(self.driver)
    action.press(x=312, y=374).wait(600).move_to(x=69, y=379).release().perform() 

```

Time to upgrade to 1.3.4 and see if it works on that.

My question, where the heck is the swipe method as it’s documented at: [https://github.com/appium/python-client/blob/master/appium/webdriver/webdriver.py](https://github.com/appium/python-client/blob/master/appium/webdriver/webdriver.py)

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 4, 2014, 6:40am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/16 "2014-12-04T06:40:23Z")

</div>

OK. Both swipe and TouchAction work for me. 1.3.1 or 1.3.3.  
Add these tests to

[https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java\_client/ios/iOSGestureTest.java](https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java_client/ios/iOSGestureTest.java)

```
@Test
  public void testSwipe() throws Exception {
  //click "Test Gesture" button
    final WebElement button = driver.findElementByName("Test Gesture");
    button.click();
  //dismiss alert
    final Alert alert = driver.switchTo().alert();
    alert.accept();
  //swipe gesture using driver.swipe
    driver.swipe(200, 200, 200, 400, 500);
    driver.swipe(200, 330, 200, 100, 500);
    driver.swipe(200, 200, 200, 400, 500);
    driver.swipe(200, 330, 200, 50, 500);
    driver.swipe(200, 200, 200, 400, 500);
    driver.swipe(200, 330, 200, 30, 500);
  }
  
  @Test
  public void testTouchAction() throws Exception {
    //click "Test Gesture" button
    final WebElement button = driver.findElementByName("Test Gesture");
    button.click();
    //dismiss alert
    final Alert alert = driver.switchTo().alert();
    alert.accept();
    //swipe gesture using TouchAction
    TouchAction action = new TouchAction(driver);
    action.press(200, 200).waitAction(500).moveTo(200, 400).release().perform();
    action.press(200, 330).waitAction(500).moveTo(200, 100).release().perform();
    action.press(200, 200).waitAction(500).moveTo(200, 400).release().perform();
    action.press(200, 330).waitAction(500).moveTo(200, 50).release().perform();
    action.press(200, 200).waitAction(500).moveTo(200, 400).release().perform();
    action.press(200, 330).waitAction(500).moveTo(200, 30).release().perform();
  }

```

Swiping up did not work for me, because the starting point somehow was not correct. I had to play with that point then everything is working.

---

<div class="post-metadata">

**Author:** ![menypeled](https://discuss.appium.io/user_avatar/discuss.appium.io/menypeled/32/97_2.png) [@menypeled](https://discuss.appium.io/u/menypeled)\
**Post date:** [December 4, 2014, 8:09am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/17 "2014-12-04T08:09:06Z")

</div>

@fangmobile,  
does the swipe work on Simulator?  
The followin swipe code works for me on iphone 5 but not on the Simulator:

## TouchAction action = new TouchAction(driver); action.press(270, 265).waitAction(500).moveTo(130, 265).release().perform();

```
	driver.swipe(270, 265, 130, 265, 500);
```

---

<div class="post-metadata">

**Author:** ![fangmobile](https://discuss.appium.io/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fangmobile](https://discuss.appium.io/u/fangmobile)\
**Post date:** [December 4, 2014, 8:25am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/18 "2014-12-04T08:25:05Z")

</div>

@menypeled Yes. works on simulator.

---

<div class="post-metadata">

**Author:** ![menypeled](https://discuss.appium.io/user_avatar/discuss.appium.io/menypeled/32/97_2.png) [@menypeled](https://discuss.appium.io/u/menypeled)\
**Post date:** [December 4, 2014, 9:45am UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/19 "2014-12-04T09:45:29Z")

</div>

very strange,  
no swipe in my Simulator when using simulator…  
I give up, will hope it will work on future versions…

---

<div class="post-metadata">

**Author:** ![tbao](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/5f8ce5/32.png) [@tbao](https://discuss.appium.io/u/tbao)\
**Post date:** [December 4, 2014, 6:00pm UTC](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688/20 "2014-12-04T18:00:16Z")

</div>

hi @menypeled,

I have the same issue as yours: the swipe action works fine on real device but on simulator it doesn’t work. I have tried with many Appium versions and still got no luck.

My latest stack is: Appium 1.3.4, java client 2.1.0, xcode 6 and ios 8.1

My current workaround is to use AppleScript to calculate the coordinate of the simulator window, then move the cursor to the center of that window and drag from there. I hate this solution because I have to create another thread to do that and of course it cannot run on a remote hub ( like SauceLab) but it’s the only way that works for me.

I really hope that we can find a better solution for this

[Next page](https://discuss.appium.io/t/swipe-broken-on-1-3-3-ios-8-1/1688.md?page=2)
