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

查看:54
本文介绍了如何使用 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天全站免登陆