<table class="customGridTable" tabindex="0" xpath="1"> <thead> <tr> <th class="customGridHeader selectionHeader"> <input type="checkbox" class="selectAllItems"> </th> <th class="customGridHeader subgridExpandHeader nonResizable"> </th> <th class="customGridHeader editHeader nonResizable"> Edit </th> <th class="customGridHeader typeHeader nonResizable"> Type </th> <th class="customGridHeader customGridSortable" style="width: 25%" data-columnid="title"> <div> <span>Title</span> <span class="columnEdit ui-button-icon-primary ui-icon ui-icon-pencil"></span> </div> </th> <th class="customGridHeader customGridSortable" style="width: 25%" data-columnid="created"> <div> <span>Created On</span> </div> </th> <th class="customGridHeader customGridSortable" style="width: 25%" data-columnid="modified"> <div> <span>Modified On</span> </div> </th> <th class="customGridHeader customGridSortable" style="width: 25%" data-columnid="keywords"> <div> <span>Keywords</span> <span class="columnEdit ui-button-icon-primary ui-icon ui-icon-pencil"></span> </div> </th> <th class="fillHeader"></th></tr> </thead> <tbody> <tr class="SearchResultItemView customGridHighlight"><td class="customGridDataCell AlignCenter"> <input type="checkbox" class="selectedItem" title="Item 1" checked="checked"></td><td class="customGridDataCell"> </td><td data-cellid="title" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>Webinar_+Integrating+Your+Test+Automation+with+Jira</span> </div> </td><td data-cellid="created" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>02/08/2019 12:12 pm</span> </div> </td><td data-cellid="modified" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>25/11/2019 03:25 pm</span> </div> </td><td data-cellid="keywords" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span></span> </div> </td></tr><tr class="SearchResultItemView"><td class="customGridDataCell AlignCenter"> <input type="checkbox" class="selectedItem"></td><td class="customGridDataCell"> <span class="subgridExpand ui-icon ui-icon-triangle-1-e"></span> </td><td class="customGridDataCell"> <span class="editRow ui-icon ui-icon-pencil"></span> </td><td class="customGridDataCell"> <div class="item_type_icon document_icon pdf"></div></td><td data-cellid="title" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>US Exp Report</span> </div> </td><td data-cellid="created" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>20/11/2019 06:08 pm</span> </div> </td><td data-cellid="modified" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>26/11/2019 10:32 am</span> </div> </td><td data-cellid="keywords" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>EditedAgain</span> </div> </td></tr><tr class="SearchResultItemView"><td class="customGridDataCell AlignCenter"> <input type="checkbox" class="selectedItem"></td><td class="customGridDataCell"> <span class="subgridExpand ui-icon ui-icon-triangle-1-e"></span> </td><td class="customGridDataCell"> <span class="editRow ui-icon ui-icon-pencil"></span> </td><td class="customGridDataCell"> <div class="item_type_icon document_icon pdf"></div></td><td data-cellid="title" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>US Exp Report</span> </div> </td><td data-cellid="created" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>20/11/2019 06:11 pm</span> </div> </td><td data-cellid="modified" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>26/11/2019 10:34 am</span> </div> </td><td data-cellid="keywords" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>EditedAgain</span> </div> </td></tr><tr class="SearchResultItemView"><td class="customGridDataCell AlignCenter"> <input type="checkbox" class="selectedItem"></td><td class="customGridDataCell"> </td><td class="customGridDataCell"> <span class="editRow ui-icon ui-icon-pencil"></span> </td> <td data-cellid="keywords" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span></span> </div> </td></tr><tr class="SearchResultItemView"><td class="customGridDataCell AlignCenter"> <input type="checkbox" class="selectedItem"></td><td class="customGridDataCell"> </td><td class="customGridDataCell"> <span class="editRow ui-icon ui-icon-pencil"></span> </td><td class="customGridDataCell"> <div class="item_type_icon document_icon pdf"></div></td><td data-cellid="title" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>todaysssss</span> </div> </td><td data-cellid="created" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>28/08/2019 02:42 pm</span> </div> </td><td data-cellid="modified" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>20/09/2019 02:54 pm</span> </div> </td><td data-cellid="keywords" class="customGridDataCell customGridEditCell "> <div class="valueContainer"> <span>sample</span> </div> </td></tr><tr class="SearchResultItemView"><td class="customGridDataCell AlignCenter"> <input type="checkbox" class="selectedItem"></td></tr></tbody> </table>
async getRows(): Promise<ElementFinder[]> {
return new Promise(async (resolve, reject) => {
this.waitForPresence();
await browser.sleep(this.gridTimeout);
resolve(this.component.element(by.css("tbody")).all(by.css("tr")));
});
}
async getRowCount() {
let retVal = 0;
await this.getRows().then(async rws => {
retVal = rws.length;
});
return retVal;
}
I have the above code to get row count, but I get 1 as the result all the time.
(我有上面的代码来获取行数,但是结果一直都是1。)
ask by Shreyas Murali translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…