所以我目前的情况是,我试图点击基于谷歌地图窗口中的标记在网页上。我已经成功定位了两种标记:element.all(by.css('.angular-google-map-marker'))
和element.all(by.repeater('m in map.markers'))
。“点击”一个不可见的元素
我已经证明,我通过更改Google地图上的位置并使用count()
来检索存在的标记数,从而在每种情况下都返回正确的数字,从而获得正确的元素。
然而,当我尝试例如element.all(by.css('.angular-google-map-marker')).first().click()
做,我收到以下错误:
Failed: element not visible
HTML节引发一些事件,由于点击有
<div ng-transclude="" style="display: none">
<span class="angular-google-map-marker" ng-transclude="" ng-repeat="m in map.markers" options="m.options" coords="m.coords" idkey="m.id" click="onMarkerClick"></span>
<span class="angular-google-maps-window" ng-transclude="" coords="activeMarker.coords" options="windowMapOptions" show="windowMapOptions.show" closeclick="closeInfoWindow" templateurl="'gMapInfoWindow.html'" templateparameter="activeMarker"></span>
</div>
通常元素属性如ng-click= foo()
,但上述标记仅使用click= foo()
。另外,如果您用div标签查看该行,则表示display: none
,这可能会解释可见性错误。
我的问题:有没有办法激活像click= foo()
这样的属性的效果而不直接点击元素?
生命的救星感谢 –