I need to click
the element
located at bottom of page then I have to click
element
located at top of page.
ie scroll up which is not visible to browser.
For scroll down I've used:
browser.actions().mouseMove(element).perform()`"
Kindly suggest solution to do this task
There are multiple ways to scroll to the very top of the page:
Via window.scrollTo()
:
browser.executeScript("window.scrollTo(0, 0);");
Locate an element on top and scroll into it's view :
var header = element(by.tagName("header")); browser.executeScript("arguments[0].scrollIntoView();", header.getWebElement());
Locate an element on top and move to it as you've demonstrated for the scroll down:
var header = element(by.tagName("header")); browser.actions().mouseMove(header).perform();
Also see:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.