title: Protractor e2e testing to find text
body: <p>I am doing e2e testing using protractor for my Angular application.
  This is my code</p>
  
  <pre><code>&lt;input type="button" value='Add New Record'/&gt;
  &lt;table class="table table-striped s10 ng-scope"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Age&lt;/th&gt;
              &lt;th&gt;Appt Time&lt;/th&gt;
              &lt;th&gt;Tag&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Bob&lt;/td&gt;
              &lt;td&gt;2&lt;/td&gt;
              &lt;td&gt;12:30AM&lt;/td&gt;
              &lt;td&gt;&lt;input type="button" value='Add Tag'/&gt;&lt;/td&gt;
          &lt;/tr&gt;
           &lt;tr&gt;
              &lt;td&gt;Alice&lt;/td&gt;
              &lt;td&gt;2&lt;/td&gt;
              &lt;td&gt;10:10AM&lt;/td&gt;
               &lt;td&gt;&lt;input type="button" value='Add Tag'/&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>My question is , if I click on 'Add New Record' it will appens a new record to the table. Here I want to test the Name of newly created record and 'Add Tag' button.
  I tried below code</p>
  
  <pre><code>it('Testing Add New Record', function(){  
      var tbl = element( by.css('.table'));
       var tblrow = tbl.all( by.css('tr')).get(0);
       var tbldata = tblrow.all(by.css('td')).get(0);
            expect(tbldata.getText()).toEqual('Alice');
       var tbldata = tblrow.all(by.css('td')).get(2);
       tbldata.click();
         });
  </code></pre>
  
  <p>It is working. But if I add one more record, we have to change the code each time. So I want to find the text of newly created record and 'Add Tag' button dynamically.</p>