How to scroll up and down in Protractor

+4 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
• 160 points
4,848 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

+2 votes
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
4,800 views
+2 votes
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
8,816 views
+1 vote
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
1,513 views
+1 vote
1 answer

Selenium webdriver in java how to automate email verification ?

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

answered Oct 19, 2020 in Software Testing by Karan
• 19,610 points

edited Jun 23, 2023 by Khan Sarfaraz 3,014 views
+1 vote
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,770 points

edited Jun 23, 2023 by Khan Sarfaraz 1,552 views
+1 vote
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
• 130 points

edited Jun 10, 2020 by Gitika 922 views
+1 vote
1 answer

How can i bypass login in Selenium webdriver?

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

answered Aug 12, 2020 in Software Testing by Karan
• 19,610 points
6,306 views
+2 votes
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
• 160 points

edited Aug 28, 2020 by Niroj 1,698 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP