'How to select a drop down menu value using robot framework?
How to select a order number from the drop down list. Page has a similar 2 more drop down with same ng-repeat. when i try to select some text, it selects matching text from other drop down. text equals also failed.
HTML:-
<select ng-repeat="select in controller.getSelects() track by select.key" ng-attr-name="select-{{select.key}}" name="select-liftId">
<option value="ALL" ng-if="select.default" class="ng-scope">ORDER NUMBER</option>
<option ng-repeat="v in select.options" value="cdfd8775-1114-462b-8a47-bc7a93e0d6ab" ng-selected="v['_id'] === controller.values[select.key]" class="ng-binding ng-scope"> 3</option>
<option ng-repeat="v in select.options" value="4f790134-31ab-4212-b152-c5c4101fbe5c" ng-selected="v['_id'] === controller.values[select.key]" class="ng-binding ng-scope"> 2</option>
<option ng-repeat="v in select.options" value="8cfb28d3-955c-45b1-877f-56b67edad6ff" ng-selected="v['_id'] === controller.values[select.key]" class="ng-binding ng-scope"> 1</option>
What i tried so far:
click element repeater=v in select.options@row[2]
click element xpath=//option[text() =${label})]
click element xpath=//option[contains(text(),'${label}')]
I would greatly appreciate any help.. Thanks.
Updated: This helped me for now... click element //select[5]/options[3]
Solution 1:[1]
click element xpath=//select/option[@value="8cfb28d3-955c-45b1-877f-56b67edad6ff"]
Solution 2:[2]
You need to list the option list first using get elements then click those list using index
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Samadi Salahedine |
| Solution 2 | Lutfi |
