问题
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?
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.
回答1:
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.
}
来源:https://stackoverflow.com/questions/39330373/how-to-go-to-next-screen-of-an-app-using-appium