1

I am not able to swipe /scroll down in an Android application, I am using codeceptjs and following method but this method will act only on the visible element but I need to scroll down to the bottom of the page /on a specific element without using any element.

 static async Scroll(){
       let locator1 = '//android.widget.ScrollView' ;
       let locator2 = '//android.widget.TextView[@text="xxx"]';
       I.swipeTo(locator1,locator2,'up',30, 200, 800);}

1 Answers1

4

I Got the answer for the same we just need to pass x and y objects to the performSwipe method like below :

I.performSwipe({x:300,y:1300},{x:300,y:300});

  • I wish I could up-vote your answer a hundred times. The official documentation is way off the mark: https://codecept.io/helpers/Appium.html (look up what it says for `performSwipe` there!!! Again, thank you very, very, very much!!! – Scott Deagan May 01 '20 at 18:21
  • I just created a PR to reflect this in the docs: https://github.com/codeceptjs/CodeceptJS/pull/3203. Thank you! – Tomáš Hübelbauer Jan 18 '22 at 08:38
  • This answer solves it, but I'm still curious. Couldn't you somehow swipe the "background element"? – s3c Feb 09 '22 at 14:40