In the iOS test, you need to use the swipe, so the Java package a set of sliding methods, not to mention, paste code
/*** Slide up 1/4 screen*/ Public voidslideup1_4 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/2, Y/3 * 2, X/2, Y/3 * 1, 0); } /*** Slide up 1/2 screen*/ Public voidslideup1_2 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/2, Y/4 * 3, X/2, Y/4 * 1, 0); } /*** Slide 1/4 screen*/ Public voidslidedown1_4 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/2, Y/3 * 1, X/2, Y/3 * 2, 0); } /*** Slide 1/2 screen*/ Public voidslidedown1_2 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/2, Y/4 * 1, X/2, Y/4 * 3, 0); } /*** Left slide 1/2 screen*/ Public voidslideleft1_2 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/4 * 3, Y/2, X/4 * 1, Y/2, 0); } /*** Left slide 2/3 screen*/ Public voidSlideleft2_3 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/3 * 2, Y/2, 0, Y/2, 0); } /*** Right Slide 1/2 screen*/ Public voidslideright1_2 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/4 * 1, Y/2, X/4 * 3, Y/2, 0); } /*** Right Slide 2/3 screen*/ Public voidSlideright2_3 () {intx =driver.manage (). window (). GetSize (). width; inty =driver.manage (). window (). GetSize (). Height; Driver.swipe (x/3 * 1, Y/2, X, Y/2, 0); } /*** Swipe up in an element to swipe up *@paramIncoming webelement*/ Public voidSlideup (Webelement a) {intx =a.getsize (). width; inty =a.getsize (). Height; Driver.swipe (x/Ten, Y/3 * 2, X/10, Y/3 * 1, 0); } /*** Swipe down in an element * *@paramIncoming webelement*/ Public voidSlidedown (Webelement a) {intx =a.getsize (). width; inty =a.getsize (). Height; Driver.swipe (x/Ten, Y/3 * 1, X/10, Y/3 * 2, 0); } /*** Swipe left in an element * *@paramIncoming webelement*/ Public voidSlideleft (Webelement a) {intx =a.getsize (). width; inty =a.getsize (). Height; Driver.swipe (x/4 * 3, Y/10, X/4 * 2, Y/10, 0); } /*** Swipe right in an element * *@paramIncoming webelement*/ Public voidSlideright (Webelement a) {intx =a.getsize (). width; inty =a.getsize (). Height; Driver.swipe (x/4 * 2, Y/10, X/4 * 3, Y/10, 0); } /*** Long Press on an element * *@paramIncoming webelement *@paramincoming Time MS **/ Public voidLongpress (Webelement el,intduration) {touchaction Action=Newtouchaction (driver); Action.longpress (el, duration); } /*** Drag an element to another element * *@paramIncoming webelement*/ Public voidTouch_webelement_to_other_webelement (webelement E1, webelement E2) {touchaction action=Newtouchaction (driver); Action.longpress (E1). MoveTo (E2); }
Appium Mobile Test Slide (ii)