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
+1 vote
2 answers

How to read data in Robot framework from excel file.

You can try run "py –m pip ...READ MORE

answered May 19 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
0 answers
0 votes
0 answers
+1 vote
0 answers

Comparing data with the data in excel sheet using Selenium Webdriver

Hello, I have written a code for registration ...READ MORE

Apr 9 in Software Testing by Kunal
• 130 points
+1 vote
1 answer