jeudi 7 septembre 2017

why is checkbox.click() not working for me?

I need to click on a checkbox that is checked by default. Here is my element:

    <input type="checkbox" name="filterMethods" id="filterMethods" ng-model="globalFilters.methods" class="ng-valid ng-touched ng-dirty ng-valid-parse ng-not-empty" style="">

When I manually uncheck the checkbox the ng-not-empty changes to ng-empty.

This is how I am trying to uncheck this checkbox:

    element(by.css('input[name=filterMethods]')).click();

This is not showing any error but the element is not getting unchecked. Can someone suggest how can I get it working? I have six such checkboxes in that block. I need to check and uncheck each of them to test the filter function. Please suggest the optimal way to achieve the same.

Aucun commentaire:

Enregistrer un commentaire