<div class="k-grid-content">
<table>
<tbody>
<tr>
<td>row1Col1</td>
<td>row1Col2</td>
<td>row1Col3</td>
</tr>
<tr>
<td>row2Col1</td>
<td>row3Col2</td>
<td>row4Col3</td>
</tr>
<tr>
<td>row3Col1</td>
<td>row3Col2</td>
<td>row3Col3</td>
</tr>
</tbody>
</table>
</div>
var grid = element.all(by.css('.k-grid-content tr')); //this will return row1,row2,row3
但我无法使用下面的代码来获取每一行及其列。
grid.each.each(function(row){
var rowElems = row.findElements(by.tagName('td'));
expect(rowElems.get(0).getText()).toMatch('/Col1/');
});
显示以下错误消息。 消息:TypeError:Object [object Object] 没有方法“findElements”
感谢@elgalu对 SO 的回答!
@elgalu @juliemr关于 StackOverflow 上的答案,对我来说“.each”并没有像 grid.filter(function(row) {
对这种奇怪的行为有什么想法吗?