How to scroll up and down in Protractor?

+3 votes

I have a scroll bar inside Window. The CSS of my scroll is '.scrollable'. I want to scroll up until the first element and scroll down until the last element, multiple times. I found the following code, but for my specific case (scroll inside the window), it doesn't help me.

browser.executeScript('window.scrollTo(0,10000);').then(function () {
            console.log('++++++SCROLLED Down+++++');

So, I replaced the window by my CSS of my scroll:

browser.executeScript('.scrollable.scrollTo(0,200);').then(function () {
            browser.executeScript('.scrollable.scrollTo(0,0);').then(function () {
Does anyone know how to solve this?
Feb 3 in Software Testing by Ingridd
• 150 points
Hey what's the error you are getting?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Software Testing

+1 vote
1 answer

How to find Predicate String and IOS Class chain through Xpath in Appium IOS Platform. ? ...READ MORE

answered Dec 2, 2019 in Software Testing by anonymous
0 votes
2 answers

What is Functional Testing in Software Testing?

Functional testing is software testing aimed to check ...READ MORE

answered Jan 6 in Software Testing by Robert
• 140 points
0 votes
0 answers

who creates blocks in JIRA product owner, client or tester

who creates blocks in JIRA product owner, ...READ MORE

Jul 3, 2019 in Software Testing by anonymous
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,510 points
0 votes
1 answer

How to scroll up/down a page using Actions class in Selenium?

Hi Naetik, you can use Actions class ...READ MORE

answered Jul 4, 2019 in Selenium by Anvi
• 14,010 points
0 votes
1 answer

BluePrism: In browser application how to spy and drag scroll bars

Depending on the spying method, BP may ...READ MORE

answered Oct 31, 2018 in RPA by Priyaj
• 57,530 points
1 flag 2,419 views
0 votes
2 answers

How to scroll down a webpage in selenium using Java?

This works... JavascriptExecutor jse = (JavascriptExecutor)driver; j ...READ MORE

answered Apr 3, 2019 in Selenium by anonymous
0 votes
1 answer

How to form user made hierarchies in tableau to drill up/down fields?

Hi Prakash, It's easy to make hierarchies to ...READ MORE

answered May 9, 2019 in Tableau by anonymous
• 32,440 points