title: Protractor - Scroll down and click
body: <p>I'm trying to simply scroll down in table and click on the element.</p>
  
  <p>This is function which I have:</p>
  
  <pre><code>    var scrollIntoView = function () {
          arguments[0].scrollIntoView();
      }
  
      element.all(by.css('div.ui-grid-selection-row-header-buttons')).then(function(arr) { 
      var row = arr[8]; 
      browser.executeScript(scrollIntoView, row.getWebElement()).then(function () { 
      row.click(); 
      }); 
      });
  </code></pre>
  
  <p>This script actually work and even scroll down, bproblem start when i use higher number (index) in arr[];</p>
  
  <p>For example 8 work, but if i use 20 it don't and I'm pretty sure there are like 50 values there so problem in that.</p>
  
  <p>Any hint will help guys</p>