如何使用appium转到应用程序的下一个屏幕? [英] How to go to next screen of an app using appium?

查看:110
本文介绍了如何使用appium转到应用程序的下一个屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何进入下一屏,例如在《印度时报》或《印度快车》应用程序或短裤新闻"应用程序中,有50个新闻报导,我想在所有页面上进行浏览,因此如何滑动至第50页?

Can anyone tell me how to go to next screen, for example like in Times of India or Indian Express app or news in shorts app, there are 50 news stories and I want to go on all the pages so how to swipe till 50th page?

我尝试了driver.swipe(344, 955, 346,247, 3000);这样我就可以滑动到下一页,但是我不确定如何一一浏览全部50页.

I tried driver.swipe(344, 955, 346,247, 3000); with that I am able to swipe to next pages, but I am not sure how go to all the 50 pages one by one.

推荐答案

您是否尝试过for循环?

Have you tried a for loop?

int pageCount = 50;
for(int currentPage = 1; currentPage < pageCount; currentPage++){
    driver.swipe(344, 955, 346,247, 3000);
    Thread.sleep(1000);//If you want to wait 1 second between pages
    //Or do whatever you want on each page.
}

这篇关于如何使用appium转到应用程序的下一个屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆