我想從一個下拉選擇角度e2e測試使用量角器的選項。
這裏是選擇選項的代碼片段:
無法在下拉選擇選項protractorjs e2e測試
<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>......`
我已經嘗試了幾乎所有的下頁
How to select option in drop down protractorjs e2e tests
他們都不似乎是爲我工作提到的方法。
我甚至無法找到'select'('option'的父項)標籤。
但是我成功地能夠點擊div.span.span元素。
另外,當我點擊下拉菜單時,我會看到一個搜索框以及所有選項。我附上相同的圖片
請幫助我。我嘗試了幾種方法,似乎沒有任何工作。
您是使用angularjs還是kendo.js。 –
我正在使用angularjs –
不太確定,Wappalyzer將「Angular material」和「Kendo UI」顯示爲Web框架。 –