简体   繁体   English

如何使用机器人框架选择下拉菜单值?

[英]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 .页面有一个类似的 2 多个下拉列表,使用相同的ng-repeat when i try to select some text, it selects matching text from other drop down.当我尝试选择一些文本时,它会从其他下拉列表中选择匹配的文本。 text equals also failed. text equals 也失败了。

HTML:- 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]更新:这对我现在有帮助...单击元素 //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