vendredi 23 décembre 2016

Unable to select option in drop down protractorjs e2e tests

I am trying to select an option from a drop down for angular e2e tests using protractor.
Here is the code snippet of the select option:

<div class="width70">
  <span title="" class="k-widget k-dropdown k-header width100 ng-scope ng-dirty ng-valid-parse ng-touched ng-invalid ng-invalid-required k-invalid" unselectable="on" role="listbox" aria-haspopup="true" aria-expanded="true" tabindex="0" aria-owns="" aria-disabled="false" aria-readonly="false" aria-busy="false" style="" aria-activedescendant="9e8e661a-e100-4c17-bceb-3de8ac876316">
    <span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input ng-scope">Select Customer</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>
    <select kendo-drop-down-list="" required="" name="customer" ng-model="arrayView.selectedCustomer" k-options="arrayView.customerList" k-rebind="arrayView.customerList" validationmessage="Select Customer" class="width100 ng-scope ng-dirty ng-valid-parse ng-touched ng-invalid ng-invalid-required k-invalid" data-role="dropdownlist" style="display: none;" aria-invalid="true">
        <option value="" selected="selected">Select Customer</option>
        <option value="615">option A</option>
        <option value="139">option B</option>
        <option value="1476">option C</option>
        <option value="570">option D</option>......`


I have tried almost all the methods mentioned in the following page
How to select option in drop down protractorjs e2e tests
None of them seems to be working for me.
I am not even able to find 'select' (parent of 'option') tag.
But I am successfully able to click on div.span.span element.

Aucun commentaire:

Enregistrer un commentaire