单击表中的列-量角器

感测器

我在HTML中有一个很大的compelx TABLE,我需要单击第一行:

<div class="ui-grid-canvas"> //this is whole table
 <div ng-repeat="(rowRenderIndex, row) in rowContainer.renderedRows track by $index" class="ui-grid-row ng-scope" ng-style="containerCtrl.rowStyle(rowRenderIndex)" ng-class="{'ui-grid-row-selected': row.isSelected}" style="margin-top: 0px;"> //this is one line
   <div ui-grid-row="row" row-render-index="rowRenderIndex" class="ng-isolate-scope"> //this is blanked part (740x0px)
    <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell ng-scope ui-grid-col0 ui-grid-row-header-cell" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" ui-grid-cell="">
     <div class="ui-grid-disable-selection ng-scope"> //stil first column
      <div class="ui-grid-cell-contents"> //stil first column
       <div class="ui-grid-selection-row-header-buttons ui-grid-icon-ok ng-scope" ng-class="{'ui-grid-row-selected': row.isSelected}" ng-click="selectButtonClick(row, $event)">&nbsp;</div> //clickable part of first element.

看起来像这样,我需要单击第20、21、22行,有人可以帮助我吗?

我尝试类似的东西:

element(by.css('.ui-grid-canvas').row(22)).element(by.css('[ng-click="selectButtonClick(row, $event)"]')).click();

但我得到错误:

r(".ui-grid-canvas") has no method 'row'

请在这里有人可以帮助我吗?

编辑:屏幕代码: 在此处输入图片说明

ec

使用element.all()by.repeater()

element.all(by.repeater('(rowRenderIndex, row) in rowContainer.renderedRows')).then(function(arr) {
  arr[20].all(by.css('[ng-click^=selectButtonClick]')).first().click();
});

在单击之前,您可能还需要滚动到该元素

var scrollIntoView = function () {
    arguments[0].scrollIntoView();
}

element.all(by.repeater('(rowRenderIndex, row) in rowContainer.renderedRows')).then(function(arr) {
    var row = arr[20];
    browser.executeScript(scrollIntoView, row.getWebElement()).then(function () {
        row.all(by.css('[ng-click^=selectButtonClick]')).first().click();
    });
});

也可以看看:

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章