title: How to count number of rows in a table in Protractor?
body: <p>I want to find number of counts of row i.e. how many tr tags are present. What should i do to automate it for protractor ? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table id="voyageGrid" class="ui-iggrid-table ui-widget-content" ng-reflect-id="voyageGrid" role="grid" aria-describedby="voyageGrid_container" style="table-layout: fixed; overflow: hidden;" cellspacing="0" cellpadding="0" border="0"&gt;
  &lt;colgroup&gt;
  &lt;thead role="rowgroup"&gt;
  &lt;tbody class="ui-widget-content ui-iggrid-tablebody ui-ig-record ui-iggrid-record" role="rowgroup"&gt;
  &lt;tr role="row" tabindex="0"&gt;
  &lt;tr class="ui-ig-altrecord ui-iggrid-altrecord" role="row" tabindex="0"&gt;
  &lt;tr role="row" tabindex="0"&gt;
  &lt;tr class="ui-ig-altrecord ui-iggrid-altrecord" role="row" tabindex="0"&gt;
  &lt;tr role="row" tabindex="0"&gt;
  &lt;tr class="ui-ig-altrecord ui-iggrid-altrecord" role="row" tabindex="0"&gt;
  &lt;tr role="row" tabindex="0"&gt;
  &lt;tr class="ui-ig-altrecord ui-iggrid-altrecord" role="row" tabindex="0"&gt;
  &lt;tr role="row" tabindex="0"&gt;
  &lt;tr class="ui-ig-altrecord ui-iggrid-altrecord" role="row" tabindex="0"&gt;
  &lt;/tbody&gt;
  &lt;tfoot id="voyageGrid_footer_container" class="" role="rowgroup" style="display: none;"/&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to have a count of tr tags i.e. there are 10 tr tags so i want <code>count = 10</code>.
  How should i proceed? Did many things but none worked
  This is something I tried but didn't work</p>
  
  <pre><code>var row = element.all(by.xpath('.//*[@class="ui-widget-content ui-iggrid-tablebody ui-ig-record ui-iggrid-record"]'));
  var value = row.all(by.tagName("tr"));
  console.log(value.count());
  </code></pre>