How to count the number of lines in Protractor Jasmine who does not have an identifier?

advertisements

Since I just started exploring protractor, I have zero knowledge on how to count the number of rows in protractor. Could anyone please help me find it?

After Logging in to a page, I am supposed to match the number of rows. Everything I tried gives a Timeout error.

Failed: Timed out waiting for Protractor to synchronize with the page after
11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/fa
q.md
Stack:
ScriptTimeoutError: asynchronous script timeout: result was not received in
11 seconds

The above is the error message I am getting..

  <table class="table table-bordered">
                      <thead>
                          <tr>

                              <th>Data Source</th><th>Server Name</th>
                              <th>Latest Source Refresh Date</th>
                              <th>QA Last Completed</th>
                              <th>Ran By</th>
                              <th><label><input type="checkbox">&nbsp;Include in QA</label></th>
                          </tr>
                      </thead>
                      <tbody>
                          <!--template bindings={}--><tr class="success">

                              <td>Austria</td><td>CDTSSQL580P.WHSVC_AT_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 08, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Mar 02, 17, 11:28 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Bulgaria</td><td>CDTSSQL807P.WHSVC_BG_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Feb 22, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 12:15 PM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Czech</td><td>CDTSSQL484P.WHSVC_CZ_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 12, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:44 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Germany</td><td>CDTSSQL826P.WHSVC_DE_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 11, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:40 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Italy</td><td>CDTSSQL350P.WHSVC_IT_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 05, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:45 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Serbia</td><td>CDTSSQL826P.WHSVC_SR_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Feb 20, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:46 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Slovakia</td><td>CDTSSQL807P.WHSVC_SK_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 11, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:46 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>Turkey</td><td>CDTSSQL484P.WHSVC_TR_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 06, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:46 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                                  <!--template bindings={}-->
                              </td>
                          </tr><tr class="success">

                              <td>UK</td><td>CDTSSQL807P.WHSVC_UK_M_IMS_1</td>
                              <td>
                                 <!--template bindings={}--><span> Mar 08, 17</span>
                                 <!--template bindings={}--> 

                              </td>
                              <td>Feb 15, 17, 4:46 AM</td>
                              <td>ims</td>
                              <td>
                                  <!--template bindings={}--><input type="checkbox">
                              <!--template bindings={}-->
                          </td>
                      </tr>
                  </tbody>
              </table>


 element.all(by.css('tbody tr')).then(function(totalRows) {
    console.log(totalRows.length);
    //OR Any expect(...)
 });