我有一个 web 元素,测试能够找到它,直到我们将 ng-if 指令插入到相同的位置。现在我的测试无法找到 web 元素:
ElementNotVisibleError:元素不可见
<select ng-if="tasktypepermission" id="elementType" ng-model="task.elementType" ng-options="key as value for (key, value) in elementTypeoptions" name="elementType" class="span3 ng-scope ng-pristine ng-valid errorForInput" data-trigger="blur focusout" tasknumber-validator="" ng-disabled="task.id">
<option class="blank" value="">Select</option>
<option value="1">Val1</option>
<option value="2">Val2</option>
<option value="3">Val3</option>
</select>
我访问元素的方式是:
var taskType = function(){ return element(by.id('elementType'));};
我应该怎么做才能让它工作?我对量角器甚至前端测试都很陌生,所以请多多包涵。