3

I have a web page to test that has a scrollview on the left side and non-scrollable view on the right side().

On the Left side I need to scroll to the bottom of the page to find a particular row element at the end of the table(The rows are dynamically generated as user scrolls).

I have tried

browser.executeScript('window.scrollTo(0,10000)').then(function(){
      //Logic to find element
})

But this is scroll the whole Page, I also tried to click on the first row of the table and apply scroll, but still the whole window scrolls.

browser.executeScript('arguments[0].scrollIntoView()', element.getWebElement());

this as well scrolls the whole window.

I tried

browser.actions().mouseMove(element(by.xpath('//*someXpath'))).perform().then(function(){
          console.log("Click Enaabled");
          browser.executeScript('window.scrollTo(0,10000)').then(function(){
          browser.sleep(5000);
        })

this does scroll the window as well. Does Protractor support anything like this use case.

2
  • Yeah it does, it just depends on the fact if you can scroll with plain javascript from for example the console like for example here. If javascript can do it, you can copy paste it to a browser.driver.executeScript(). Hope it helps Commented Apr 12, 2017 at 18:31
  • this does not work for me either, as the element I'm looking for does not have a id(until the row is rendered) and more over I'm looking to just scroll the container so that the element is in the view then I can grab the element. Commented Apr 12, 2017 at 19:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.