Appium webdriver.swipe method seems not to work on iOS

Here are the details of my test setup:
Appium 1.5.2
Xcode: 7.3.1
iOS Simulator: iPad Air 2, iOS 9.3

After appium starts up the Simulator, I navigate to a page where I am trying to swipe up/down and use the following code using the python binding:

webdriver.swipe(start_x, start_y, end_x, end_y)

Now having a look at the recent topics on the forums it seems that the x,y co-ordinates for iOS have been reversed so that x is the height and y is the width. But no matter what start/end values I put in the method or even if I try and reverse the x,y coordinates I still see appium trying to swipe up all the time. Im not sure if the swipe method has broken again or if this is an issue in my AUT.

Ill try and add appium logs later.

AppiumServer.log (474.6 KB)

The swipe functionality is always moving the “finger” downwards, so it looks like the screen is scrolling up. The reason why the finger is always swiping down is partially my fault, because I wrote some documentation for the swipe functionality that documented the wrong behavior.

When you call moveTo(int, int), the parameters are changes in the position, not absolute positions. Try passing in a negative value for the y-parameter. Any xy coordinate orientation should be handled by Appium, so you are free to assume that the positive x-axis points to the right, and the positive y-axis points downward.

Same I noticed when working with swipe. Irrespective of how the co-ordinates you mention it works in on direction(downwards) only. Surely this is a defect

Appium 1.5.2
Xcode 7.3

Hi Alex,

Thanks a lot for your reply and for the clarification. We have finally got it working using this: = action[direction][‘start_x’], y=action[direction][‘start_y’])
.move_to(x = action[direction][‘end_x’], y= action[direction][‘end_y’]).release().perform()

Although it would be good if the swipe method would have worked directly. Is there an open bug for that?

Ah, woops! Sorry, I wrote that post while talking about the Java library implementation. The other language bindings should be fine, so if you see anything weird, you might want to write up an issue on Appium’s Github.

Appium iOS - Python

el = self.driver.find_element_by_id('Comment')
    self.driver.execute_script('mobile: scroll', {"element": el, "toVisible": True})