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
674 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
1,061 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 in Software Testing by anonymous
1,292 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 in Software Testing by Karan
• 16,040 points
77 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 in Software Testing by anonymous
• 120 points

edited Jun 10 by Gitika 69 views
0 votes
1 answer
+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 in Software Testing by Titus
• 150 points

edited Aug 28 by Niroj 94 views
0 votes
3 answers

What is Functional Testing in Software Testing?

Hello, I hope this info is useful to ...READ MORE

answered Aug 20 in Software Testing by anonymous
• 200 points

edited Aug 20 by Gitika 159 views
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
82 views