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.

Vikram Belde
  • 979
  • 8
  • 16
  • 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](http://stackoverflow.com/questions/635706/how-to-scroll-to-an-element-inside-a-div). If javascript can do it, you can copy paste it to a `browser.driver.executeScript()`. Hope it helps – wswebcreation Apr 12 '17 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. – Vikram Belde Apr 12 '17 at 19:43

0 Answers0