javascript - Protractor: Not able to retrieve all the values from multiple rows in a web-table -
i have web-table multiple rows. want retrieve data , verify. reason method return value first row. can 1 tell wrong?
method:
validatepolicyversiontable(){ return element.all(by.repeater('row in table.filtered track table.idpropertyfn(row)')).then(numofrows=>{ let length = numofrows.length; let tabledataarray = []; (let = 0; < length; i++) { let rows= element(by.repeater('row in table.filtered track table.idpropertyfn(row)').row(i)); let cells = rows.all(by.tagname('td')); tabledataarray= cells.map(celltext=>{ return celltext.gettext(); }); } return tabledataarray; }) }
i this
validatepolicyversiontable() { const rows = element.all(by.repeater('row in table.filtered track table.idpropertyfn(row)')); return rows.map((row) => row.$$('td').gettext()); }
if fetching text of elementarrayfinder
array of strings (the row.$$('td').gettext()
). result this
[ ['row1celltext1', 'row1celltext2', 'row1celltext3'], ['row2celltext1', 'row2celltext2', 'row2celltext3'], ['row3celltext1', 'row3celltext2', 'row3celltext3'] ]
Comments
Post a Comment