title: How to get the text of all elements in protractor
body: <p>I want to fetch all the <code>li</code> texts of suggestions after entering in the google search bar "Webdriver". I have wrote some code like this:</p>
  
  <pre><code> this.getElements = function(){
    element.all(by.css('ul.sbsb_b')).then(function(text){
        for(var i=0; i &lt; text.length;i++)
        {
            console.log(text[i].getText());
        }
    });
  };
  </code></pre>
  
  <p>On execution I m getting something like: </p>
  
  <pre><code>{ ptor_: 
    { controlFlow: [Function],
       schedule: [Function],
       getSession: [Function],
       getCapabilities: [Function],
       quit: [Function],
  </code></pre>
  
  <p>instead of text values of Suggestions.</p>