如何使用 appium 转到应用程序的下一个屏幕?

编程入门 行业动态 更新时间:2024-10-27 02:21:08
本文介绍了如何使用 appium 转到应用程序的下一个屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

谁能告诉我如何进入下一个屏幕,例如在印度时报或印度快车应用程序或短片应用程序中的新闻,有 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 18:24:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/919160.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转到   如何使用   应用程序   屏幕   appium

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!