'How select options from a smart-select?
I am trying to get all the options from a dropdown with Selenium but I get the exception that the Select module does not work with smart-select. Is there any way to get the values of this dropdown with selenium?
Message: Select only works on <select> elements, not on <smart-select>
Edit: This is the HTML:
<smart-select _ngcontent-xhq-c24="" class="col-3" ng-reflect-list="[object Object],[object Object">
<div tabindex="3" class="search-select" ng-reflect-ng-class="[object Object]">
<div class="custom-select" ng-reflect-klass="custom-select" ng-reflect-ng-class="[object Object]">
<!--bindings={
"ng-reflect-ng-if": "true"
<span>6. Element 6</span>
<!--bindings={}-->
<!--bindings={
"ng-reflect-ng-if": "false"
</div>
<div class="select-drop">
<!--bindings={
"ng-reflect-ng-if": "false"
<ul class="select-results">
<!--bindings={
"ng-reflect-ng-for-of": "[object Object],[object Object"
<li ng-reflect-ng-class="[object Object]"> 1. Element 1 </li>
<li ng-reflect-ng-class="[object Object]"> 2. Element 2 </li>
<li ng-reflect-ng-class="[object Object]"> 3. Element 3 </li>
<li ng-reflect-ng-class="[object Object]"> 4. Element 4 </li>
<li ng-reflect-ng-class="[object Object]"> 5. Element 5 </li>
<li class="option-selected" ng-reflect-ng-class="[object Object]"> 6. Element 6 </li>
</ul>
</div>
</div>
<!--bindings={}
<!--bindings={
"ng-reflect-ng-if": "false"
</smart-select>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
