Swipe for Android (Appium Version 1.7.1) - Dynamic Horizontal Scroll
**Custom Keyword:
**-------------------------------------------------------------------------------
@Keyword
def getdevicelocator(){
int device_Height, device_Width
device_Height = Mobile.getDeviceHeight()
println device_Height
device_Width = Mobile.getDeviceWidth()
println device_Width
int midheight = device_Height/2
println midheight
int midwidth = device_Width/2
println midwidth
int startX,startY,endX,endY
startX = device_Width-100
startY = midheight
endX = -startX
endY = 0
Mobile.swipe(startX,startY,endX,endY)
}
**Test Case:
**
CustomKeywords.‘functions.scroll.getdevicelocator’()
-------------------------------------------------------------------------------
Swipe for Android (Appium Version 1.7.1) - Static Horizontal Scroll according to device resolution coordinates will change
Mobile.swipe(700, 600, -600, 0)
Refer Link: https://docs.katalon.com/display/KD/[Mobile]+Swipe
-------------------------------------------------------------------------------
In case if your appium version is below 1.7.1 (Relative Scroll will not work)
Mobile.swipe(700, 600, 100, 600)