Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I have a button on my page that is visible when the user scrolls down. Because of this, protractor tests give me an error:

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

I tried using:

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

which worked when I tested it in protractors elementexplorer.js but in my regular tests it doesn't do anything. Any other way around this?

1 Answer

0 votes
by (62.9k points)

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();

Browse Categories

...