I’m trying to test UI with (Selenium). I have a drop down which is dynamically populated and i have to one of the text in it. I’m able to click on the dropdown which then shows the as a popup. But not able to select any of the elements. When i try to access the dropdown using Select from , it returns an error stating its not a . Since its the ID are not constant.

*<kendo-dropdownlist name="sel" style="width: 400px;" ng-reflect-data="[object Object],[object Object" ng-reflect-text-field="Name" ng-reflect-value-field="Id" ng-reflect-default-item="[object Object]" ng-reflect-value-primitive="true" ng-reflect-name="sel" class="k-widget k-dropdown k-header ng-valid ng-touched ng-dirty" ng-reflect-model="-9999">
<span role="listbox" unselectable="on" class="k-dropdown-wrap k-state-default k-state-focused" ng-reflect-ng-class="[object Object]" id="5c2a0848-f6fa-433f-a927-8b645ac4047b" dir="ltr" readonly="false" tabindex="0" aria-disabled="false" aria-readonly="false" aria-haspopup="true" aria-expanded="false" aria-owns="c7cb9422-f181-4b66-905e-eaa05305a0e9" aria-activedescendant="b0f86e8c-1fea-4bee-9367-39a207fa4859-undefined">
<span unselectable="on" class="k-input" ng-reflect-ng-class="[object Object]">
<span unselectable="on" class="k-select" ng-reflect-ng-class="[object Object]">
</span>
</kendo-dropdownlist>*


*<kendo-popup class="ng-tns-c7-14 k-animation-container ng-star-inserted k-animation-container-shown" dir="ltr" style="left: 189.6px; top: 338.2px; min-width: 400px; width: 400px;">
<div class="k-popup ng-trigger ng-trigger-toggle k-list-container k-reset" ng-reflect-klass="k-popup" ng-reflect-ng-class="k-list-container,k-reset">
<div kendodropdownsselectable="" class="k-state-focused k-state-selected ng-star-inserted k-list-optionlabel" ng-reflect-ng-class="[object Object]" ng-reflect-index="-1" aria-selected="true" style="">Please Select</div>
<kendo-list ng-reflect-data="[object Object],[object Object" ng-reflect-text-field="Name" ng-reflect-value-field="Id" ng-reflect-height="200" ng-reflect-show="true" ng-reflect-id="c7cb9422-f181-4b66-905e-eaa053" ng-reflect-option-prefix="b0f86e8c-1fea-4bee-9367-39a207" class="ng-star-inserted" style="">
<div unselectable="on" class="k-list-scroller" ng-reflect-ng-class="[object Object]" style="max-height: 200px;">
<ul role="listbox" class="k-list k-reset" ng-reflect-ng-class="[object Object]" id="c7cb9422-f181-4b66-905e-eaa05305a0e9" aria-hidden="false">
<li kendodropdownsselectable="" role="option" class="k-item ng-star-inserted" ng-reflect-ng-class="[object Object]" ng-reflect-index="0" ng-reflect-multiple-selection="false" id="b0f86e8c-1fea-4bee-9367-39a207fa4859-5560" tabindex="-1">
................
................
<li kendodropdownsselectable="" role="option" class="k-item ng-star-inserted" ng-reflect-ng-class="[object Object]" ng-reflect-index="10" ng-reflect-multiple-selection="false" id="b0f86e8c-1fea-4bee-9367-39a207fa4859-5360" tabindex="-1">
</ul>
</div>
</kendo-list>
</div>
</kendo-popup>*

Any help or pointers would be highly appreciated. Thanks.



Source link https://sqa.stackexchange.com/questions/34853/how-to-select-a-dynamic-list-element-in-robot-framework

LEAVE A REPLY

Please enter your comment!
Please enter your name here