There are several ways to swipe in Appium. Here is the method we wrote in Ruby to make the call a bit simpler:
def swipe(start_x, start_y, end_x, end_y)
action = Appium::TouchAction.new.press(x: start_x, y: start_y).wait(10).move_to(x:end_x, y:end_y).wait(50).release(x: end_x, y: end_y)
action.perform
end
You'll need to determine start and end values for x and y. In the example below, we want to swipe across a tab element in the Android settings.
tab = appium.driver.find_element(:id, 'com.android.settings:id/tabs')
dimensions = apm.appium_module.window_size
max_x = dimensions.width - 1
swipe(max_x, tab.location.y + 5, tab.location.x, tab.location.y + 5)