I want to scroll an android mobile app page from top to bottom.
-
I have tried with below defined coding for scroll and click for specific web element using text. It works fine.
// method 1 driver.scrollTo("R");
// method 2 driver.ScrollToExact("Top");
But I need to swipe an full article page from top to bottom, without using above scroll() methods. I have tried with below coding, but scroll action doesn't happens for me. // scroll to bottom of an page
((JavascriptExecutor) driver) .executeScript("window.scrollTo(0, document.body.scrollHeight)");
How can I scroll an android app page from top to bottom using appium driver?
I am writing mobile app automation test for my app.
Steps:-
1. List of all articles will displayed -
2. I click on first article In article page, there is a image at center of the article(need to scroll to see full article). Image at centre will appear when we scroll to that position.
I want to assert that image is present or image. To do it, I need to scroll and find.How can i do it?I have tried the following:-
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("direction", "down");
js.executeScript("mobile: scroll", scrollObject);
Result:-But appium says as Not yet implemented..
created
Aug '15
last reply
Feb '18
- 23
replies
- 46.2k
views
- 14
users
- 3
likes
- 3
links