我有一个网格,上面有5个元素。而且我有旅行的时间。我需要在网格中获取项目的总数,但它使用的是对象。我该怎么做?
我不理解HTML,它使用对象吗?我不知道该怎么做。
**部分HTML:**
<div class="ui-datatable-tablewrapper">
<table>
<thead>
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><tr class="ui-state-default">
<!--template bindings={
"ng-reflect-ng-for-of": "[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
}--><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Tipo de Norma</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Número</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Ano</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Descrição</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Status</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Data de Publicação</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="ui-state-default ui-unselectable-text" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title">Ativo</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th><th ng-reflect-raw-class="[object Object]" class="kebab-column ui-state-default ui-unselectable-text" ng-reflect-initial-classes="kebab-column" draggable="false" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-column-title"></span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</th>
</tr>
<!--template bindings={
"ng-reflect-ng-for-of": null
}-->
</thead>
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<tbody class="ui-datatable-data ui-widget-content">
<!--template bindings={
"ng-reflect-ng-for-of": "[object Object],[object Object],[object Object],[object Object],[object Object]"
}-->
<tr class="ui-widget-content ui-datatable-even" ng-reflect-raw-class="[object Object]" ng-reflect-initial-classes="ui-widget-content">
<!--template bindings={
"ng-reflect-ng-for-of": "[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
}--><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">Lei</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">1800</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">1800</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">Teste para ver se norma esta desativada</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">Revogado</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">01/08/2016</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">Inativo</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" class="kebab-column" ng-reflect-initial-classes="kebab-column" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "[object Object]"
}--><span class="ui-cell-data">
<p-columntemplateloader ng-reflect-column="[object Object]" ng-reflect-row-data="[object Object]" ng-reflect-row-index="0"></p-columntemplateloader>
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><button class="btn btn-flat btn-no-text btn-kebab-view">
<i class="zmdi zmdi-more-vert"></i>
</button>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td>
</tr>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<tr class="ui-widget-content ui-datatable-odd" ng-reflect-raw-class="[object Object]" ng-reflect-initial-classes="ui-widget-content">
<!--template bindings={
"ng-reflect-ng-for-of": "[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
}--><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">Resolução</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">333</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">2011</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">teste</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
</td><td ng-reflect-raw-class="[object Object]" style="display: table-cell;">
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "true"
}--><span class="ui-cell-data">Revogado</span>
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": null
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
<!--template bindings={
"ng-reflect-ng-if": "false"
}-->
。。。
</div>
量角器只是Selenium的有用包装,您不应访问任何JavaScriptObject
来计数。为了计算表中的行,请使用element.all(by.css('table td'))
。
如果您有分页,这将使计数变得更加棘手。您可以将上述调用包装在一个.each
循环中。在循环中,您转到下一页,等待其加载,然后计数。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句