【问题标题】:Protractor - Element is not clickable at point (x,y) when using ng-change量角器 - 使用 ng-change 时元素在点 (x,y) 处不可点击
【发布时间】:2015-05-14 07:26:46
【问题描述】:
<select id="cbCategory" ui-select2 name="cbCategory" ng-model="categoryCombo.category" 
        class="show-tick form-control comboBlue" ng-change="loadPrice()" required>
    <option ng-repeat="category in Categories" value="{{category}}" 
            {{category.Name}}</option>
</select>

当我像这样选择时,没有ng-change,它适用于这两种解决方案:

1。 element.all(by.repeater('category in Categories').row(0)).click();

2。 element(by.id("cbCategory")).sendKeys('Category1');

但是当我在我的选择中有ng-change 时,两种解决方案都不起作用。

【问题讨论】:

    标签: javascript testing selenium protractor end-to-end


    【解决方案1】:

    在点击option之前点击select,例如:

    var selectElement = element(by.id("cbCategory"));
    selectElement.click();
    
    var option = selectElement.all(by.tagName("option")).first();
    option.click();
    

    您可能还希望通过进行抽象来更轻松地使用 select->option,请参阅:

    【讨论】:

    • 我试过了,但没有用,但在 github-protractor 问题上我得到了正确的答案。 [链接] (github.com/angular/protractor/issues/2137) 它与 loadPrice() 有关。无论如何,tnx,最好的问候
    猜你喜欢
    • 2020-04-14
    • 2016-10-02
    • 1970-01-01
    • 2018-11-07
    • 1970-01-01
    • 2016-10-19
    • 2016-08-22
    • 1970-01-01
    • 2016-03-30
    相关资源
    最近更新 更多