Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 自AngularJS 1.4:量角器don';在参数化表中找不到ng bind html by.binding_Javascript_Angularjs_Protractor_Ng Bind Html - Fatal编程技术网

Javascript 自AngularJS 1.4:量角器don';在参数化表中找不到ng bind html by.binding

Javascript 自AngularJS 1.4:量角器don';在参数化表中找不到ng bind html by.binding,javascript,angularjs,protractor,ng-bind-html,Javascript,Angularjs,Protractor,Ng Bind Html,由于我将AngularJS升级到1.4版本,所以我的量角器测试用例是KO。 测试步骤如下: var allRows = element.all(by.repeater('row in displayedElts')); expect(allRows.count()).to.eventually.equal(1); allRows.first().then(function (row) { row.element(by.binding('row.label')).then(function

由于我将AngularJS升级到1.4版本,所以我的量角器测试用例是KO。 测试步骤如下:

var allRows = element.all(by.repeater('row in displayedElts'));
expect(allRows.count()).to.eventually.equal(1);
allRows.first().then(function (row) {
    row.element(by.binding('row.label')).then(function (elm1) {
    ...
    }
}
<table>
  <tbody>
     <tr ng-repeat-start="row in displayedElts">
        <td ng-repeat="col in tableSpec.columns" ng-bind-html="row[col.field] | cldApply:col.filter"></td>
     </tr>
  </tbody>
</table>
$scope.tableSpec= {
    columns: [
       {
          field: 'label',
          labelKey: 'commons.label',
          filter : 'cldNone'
       },
       ...
   ]
}
错误消息是:

NoSuchElementError: No element found using locator: by.binding("row.label")
html代码如下所示:

var allRows = element.all(by.repeater('row in displayedElts'));
expect(allRows.count()).to.eventually.equal(1);
allRows.first().then(function (row) {
    row.element(by.binding('row.label')).then(function (elm1) {
    ...
    }
}
<table>
  <tbody>
     <tr ng-repeat-start="row in displayedElts">
        <td ng-repeat="col in tableSpec.columns" ng-bind-html="row[col.field] | cldApply:col.filter"></td>
     </tr>
  </tbody>
</table>
$scope.tableSpec= {
    columns: [
       {
          field: 'label',
          labelKey: 'commons.label',
          filter : 'cldNone'
       },
       ...
   ]
}
过滤器cldApply的代码(如果需要):

过滤器在显示之前应用trustAsHtml清理代码

此代码在升级到AngularJS 1.4之前正常运行


任何线索都将不胜感激,因为我被困在这个案例中。

您是否尝试过
by.exactBinding(“row.label”)
替代?感谢您的建议,但结果类似:NoSuchElementError:未找到使用定位器的元素:by.exactBinding(“row.label”)您是否尝试过
by.exactBinding(“row.label”)
取而代之的是?感谢您的建议,但结果类似:NoTouchElementError:使用locator:by.exactBinding(“row.label”)找不到元素