Scrolling down in Protractor

0 votes

There is a button on my page which becomes visible when the user scrolls down. As a result, protractor tests give me an error:

UnknownError: unknown error: Element is not clickable at point (94, 188).

I tried this code:

browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');

This actually worked in my protractor tests elementexplorer.js. But doesn't work in my regular tests. Any other way around this?

May 24, 2018 in Selenium by eLiJha
• 770 points
9,702 views

1 answer to this question.

0 votes

You need to wait for the scrolling to complete before any click works. Try this: 

browser.executeScript('window.scrollTo(0,0);').then(function () {
    page.saveButton.click();
})

Or this could also be another way of getting it done.

browser.actions().mouseMove(element).perform();
answered May 24, 2018 by sniffy_god
• 780 points

Related Questions In Selenium

0 votes
1 answer

Finding parent element in Protractor

To get the parent element, you can ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
3,404 views
0 votes
2 answers

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

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
18,504 views
0 votes
1 answer

How to choose from a drop-down in Selenium 2?

You can probably use the 'Select' class ...READ MORE

answered Apr 24, 2018 in Selenium by king_kenny
• 3,710 points
950 views
0 votes
1 answer

(Protractor) Finding specific row in ng-table by text

Try this Return the filtered elements before trying ...READ MORE

answered May 10, 2018 in Selenium by Samarpit
• 5,910 points
9,797 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,749 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,620 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,697 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,560 views
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
25,600 views
0 votes
1 answer

Difference between submit() vs click() in Selenium Webdriver

The submit() function is specifically for forms ...READ MORE

answered May 24, 2018 in Selenium by sniffy_god
• 780 points
7,418 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