[Ruby version][ios] Imposible to perform swipe

Using appium 1.5.2.
I know the endpoints are relative to the start points, but I can’t get it working.

Resolution (got it by Appium::Common.window_size)
Screen width = 320
Screen height = 568

My code:

element = wait{find_element(:xpath => "//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAImage[4]")}
action = Appium::TouchAction.new
x1  = element.location.x
y1 = element.location.y
x2 = element.size.width
y2 = 0
duration = 500
action.swipe({:start_x => x1, :start_y => y1, :end_x => x2, :end_y => y2, :duration => duration}).perform

Appium Log:

[debug] [UIAuto] Socket data received (68 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"x":59.54206085205078,"y":456.4312744140625}}
[MJSONWP] Responding to client with driver.getLocation() result: {"x":59.54206085205078,"y":456.4312744140625}

[HTTP] <-- GET /wd/hub/session/23ef0a3a-0945-4e38-8f9e-a0bc88b2cd30/element/0/location 200 1091 ms - 117 
[HTTP] --> GET /wd/hub/session/23ef0a3a-0945-4e38-8f9e-a0bc88b2cd30/element/0/size {}
[MJSONWP] Calling AppiumDriver.getSize() with args: ["0","23ef0a3a-0945-4e38-8f9e-a0bc88b2cd30"]
[debug] [iOS] Executing iOS command 'getSize'
[debug] [UIAuto] Sending command to instruments: au.getElement('0').getElementSize()

[debug] [Instruments] [INST] 2016-06-08 07:35:35 +0000 Debug: Got new command 17 from instruments: au.getElement('0').getElementSize()

[debug] [Instruments] [INST] 2016-06-08 07:35:35 +0000 Debug: evaluating au.getElement('0').getElementSize()

[debug] [Instruments] [INST] 2016-06-08 07:35:35 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-06-08 07:35:35 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-06-08 07:35:35 +0000 Debug: Running system command #18: /Applications/Appium 1.5.2.app/Contents/Resources/node/bin/node /Applications/Appium 1.5.2.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/q6/h757481s0331g8jz4t7tg1300000gp/T/instruments_sock 2,{"...

[debug] [UIAuto] Socket data received (76 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"width":139.9158935546875,"height":257.137451171875}}

[MJSONWP] Responding to client with driver.getSize() result: {"width":139.9158935546875,"height":257.137451171875}
[HTTP] <-- GET /wd/hub/session/23ef0a3a-0945-4e38-8f9e-a0bc88b2cd30/element/0/size 200 955 ms - 125 
[HTTP] --> POST /wd/hub/session/23ef0a3a-0945-4e38-8f9e-a0bc88b2cd30/touch/perform {"actions":[{"action":"press","options":{"x":59.54206085205078,"y":456.4312744140625}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"x":139.9158935546875,"y":0}},{"action":"release"}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"press","options":{"x":59.54206085205078,"y":456.4312744140625}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"...
[debug] [iOS] Executing iOS command 'performTouch'
[debug] [UIAuto] Sending command to instruments: target.touch([{"touch":[{"x":59.54206085205078,"y":456.4312744140625}],"time":0.2},{"touch":[{"x":59.54206085205078,"y":456.4312744140625}],"time":0.7},{"touch":[{"x":199.45795440673828,"y":456.4312744140625}],"time":0.8999999999999999}])

[debug] [Instruments] [INST] 2016-06-08 07:35:36 +0000 Debug: Got new command 18 from instruments: target.touch([{"touch":[{"x":59.54206085205078,"y":456.4312744140625}],"time":0.2},{"touch":[{"x":59.54206085205078,"y":456.4312744140625}],"time":0.7},{"touch":[{"x":199.45795440673828,"y":456.4312744140625}],"time":0.8999999999999999}])

[debug] [Instruments] [INST] 2016-06-08 07:35:36 +0000 Debug: evaluating target.touch([{"touch":[{"x":59.54206085205078,"y":456.4312744140625}],"time":0.2},{"touch":[{"x":59.54206085205078,"y":456.4312744140625}],"time":0.7},{"touch":[{"x":199.45795440673828,"y":456.4312744140625}],"time":0.8999999999999999}])

[debug] [Instruments] [INST] 2016-06-08 07:35:36 +0000 Debug: target.touch(__NSCFArray)

[debug] [Instruments] [INST] 2016-06-08 07:35:37 +0000 Debug: evaluation finished

[debug] [Instruments] [INST] 2016-06-08 07:35:37 +0000 Debug: responding with:

[debug] [Instruments] [INST] 2016-06-08 07:35:37 +0000 Debug: Running system command #19: /Applications/Appium 1.5.2.app/Contents/Resources/node/bin/node /Applications/Appium 1.5.2.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/q6/h757481s0331g8jz4t7tg1300000gp/T/instruments_sock 2,{"...

[debug] [UIAuto] Socket data received (25 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":""}
[MJSONWP] Responding to client with driver.performTouch() result: null

[HTTP] <-- POST /wd/hub/session/23ef0a3a-0945-4e38-8f9e-a0bc88b2cd30/touch/perform 200 1913 ms - 76 

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.2","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 11 ms - 83 

[HTTP] --> GET /wd/hub/status {}

Also tryed with world position (knowing it’s not the way, but in the github repo for appium: TouchActions github

    # Convenience method to peform a swipe.
    #
    # Note that iOS 7 simulators have broken swipe.
    #
    # @option opts [int] :start_x Where to start swiping, on the x axis.  Default 0.
    # @option opts [int] :start_y Where to start swiping, on the y axis.  Default 0.
    # @option opts [int] :end_x Where to end swiping, on the x axis.  Default 0.
    # @option opts [int] :end_y Where to end swiping, on the y axis.  Default 0.
    # @option opts [int] :duration How long the actual swipe takes to complete in milliseconds. Default 200.

Also in the ruby documentation: Ruby Doc

Convenience method to peform a swipe.

Note that iOS 7 simulators have broken swipe.

Parameters:
opts (Hash) — a customizable set of options
Options Hash (opts):
:start_x (int) — Where to start swiping, on the x axis. Default 0.
:start_y (int) — Where to start swiping, on the y axis. Default 0.
:end_x (int) — Where to end swiping, on the x axis. Default 0.
:end_y (int) — Where to end swiping, on the y axis. Default 0.
:duration (int) — How long the actual swipe takes to complete in milliseconds. Default 200.

(anything about relative coordinates, I think it should be updated)

How the swipe should be performed? Also I have tried adding waits everywhere…

Thank you all for your time

Anything? My iOS testing version is now stopped for that…