如何使用量角器从网格中获取列数据

How to get column data from a grid using protractor?

本文关键字:获取 数据 网格 何使用 量角器      更新时间:2023-09-26

我无法访问网格列中的数据。

谁能提出除以下方法以外的其他方法吗?

element.all(by.repeater('col in colContainer.renderedColumns track by col.uid').column('Entity'))
    .getText()
    .then(console.log);

尝试使用element.all(by.css('tr')).get(rowNumber).all(by.css('td')).get(colNumber).getText();

我的建议是:

 PageGrid.all(by.repeater('item in grid.items')).then(function (rows) {
                rows.forEach(function (row) {
                    row.all(by.repeater('column in row.columns')).then(function (columns) {
                        columns[3].getText().then(function (columnText) { //Fetching the desired column value from its column number in Grid which starts from 1 , not zero.
                           console.log(columnText) ;
                        });
                    });
                });
 });