簡體   English   中英

如何使用機器人框架選擇下拉菜單值?

[英]How to select a drop down menu value using robot framework?

如何從下拉列表中選擇訂單號。 頁面有一個類似的 2 多個下拉列表,使用相同的ng-repeat 當我嘗試選擇一些文本時,它會從其他下拉列表中選擇匹配的文本。 text equals 也失敗了。

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>

到目前為止我嘗試過的:

click element   repeater=v in select.options@row[2]


click element   xpath=//option[text() =${label})]

click element   xpath=//option[contains(text(),'${label}')]

我將不勝感激任何幫助..謝謝。

更新:這對我現在有幫助...單擊元素 //select[5]/options[3]

單擊元素 xpath=//select/option[@value="8cfb28d3-955c-45b1-877f-56b67edad6ff"]

您需要先使用 get 元素列出選項列表,然后使用索引單擊這些列表

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM