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, 2020 in Software Testing by Ingridd
• 150 points
2,132 views
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. ?

https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain- ...READ MORE

answered Dec 2, 2019 in Software Testing by anonymous
2,018 views
+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, 2020 in Software Testing by anonymous
4,097 views
0 votes
1 answer

How can we connect Selenium to Existing browser in Ruby Programming language?

Check this out https://www.browserstack.com/docs/automate/sele ...READ MORE

answered Aug 11, 2020 in Software Testing by Karan
• 19,610 points
349 views
0 votes
1 answer

Selenium webdriver in java how to automate email verification ?

Hey @Manali, check this out https://blog.mailtrap.io/selenium-email-ve ...READ MORE

answered Oct 19, 2020 in Software Testing by Karan
• 19,610 points
722 views
0 votes
1 answer

How to do stress testing in Apache flink? Kindly suggest the tool which is used to do stress testing.

Hey, @Savitha, Loadrunner from HP is the widely used ...READ MORE

answered Dec 9, 2020 in Software Testing by Gitika
• 65,930 points
192 views
0 votes
0 answers

How to Communicate OTP from email to intelliJ using cucumber

Hi, I want to communicate OTP from gmail ...READ MORE

Jun 10, 2020 in Software Testing by anonymous
• 120 points

edited Jun 10, 2020 by Gitika 217 views
0 votes
1 answer

How can i bypass login in Selenium webdriver?

Hey @Pranish, here's a method that uses ...READ MORE

answered Aug 11, 2020 in Software Testing by Karan
• 19,610 points
1,724 views
+1 vote
0 answers

Hello. Iam testing a php script and i get a notice error how do i fix it?

A PHP Error was encountered Severity: Notice Message: Undefined ...READ MORE

Aug 28, 2020 in Software Testing by Titus
• 150 points

edited Aug 28, 2020 by Niroj 282 views