使用量角器双击在chrome中效果良好,但在firefox中不起作用

double click using protractor worked fine in chrome but not working in firefox

本文关键字:但在 不起作用 firefox 量角器 双击 chrome      更新时间:2023-09-26

下面是我用来双击元素的代码片段,该元素在chrome浏览器中运行良好,但在firefox中不起作用。

browser.actions().doubleClick(element(by.repeater('row in renderedRows').row(0))).perform();

下面是HTML代码段:

<div class="ng-scope ngRow even" ng-row="" ng-class="row.alternatingRowClass()" ng-click="row.toggleSelected($event)" ng-repeat="row in renderedRows" ng-style="rowStyle(row)" style="top: 0px; height: 30px;">
<!-- ngRepeat: col in renderedColumns -->
<div class="ngCell col0 colt0" ng-class="col.colIndex()" ng-repeat="col in renderedColumns" ng-style="{ }" ng-click="showDetail(row.entity)" ng-dblclick="viewBothPanes()">
<div class="ngVerticalBar ngVerticalBarVisible" ng-class="{ ngVerticalBarVisible: !$last }" ng-style="{height: rowHeight}" style="height: 30px;"/>
<div ng-cell="">
<div class="ngCellText ng-scope col0 colt0" ng-class="col.colIndex()">
</div>
</div>
<!-- end ngRepeat: col in renderedColumns -->
<div class="ngCell col1 colt1" ng-class="col.colIndex()" ng-repeat="col in renderedColumns" ng-style="{ }" ng-click="showDetail(row.entity)" ng-dblclick="viewBothPanes()">`

我的场景是:

我们有ng网格,它有很多行,我需要双击一行,正如预期的那样,它运行得很好,但当同一个tescase在firefox中运行时,它识别了行,但没有双击该行。

这很容易与firefox 35和selenium 2.44之间的不兼容问题有关。

当前的解决方法是firefox降级到34.0.5,或者,由于selenium 2.45今天发布,从github主分支安装protractor

查看更多信息:

  • 使用带量角器的Firefox 35会导致错误