Selenium webdriver 检查SelectBox是否包含项目、Robot框架、Selenium2库
如何检查一个Selenium webdriver 检查SelectBox是否包含项目、Robot框架、Selenium2库,selenium-webdriver,robotframework,Selenium Webdriver,Robotframework,如何检查一个框中是否有多个 使用ajax加载,并放置在两个中 <option value="">default</option> <optgroup ...> <option value=..>... <option ..>... ... </optgroup> <optgroup ...> <option ..>... <option ..>...
框中是否有多个
使用ajax加载,并放置在两个
中
<option value="">default</option>
<optgroup ...>
<option value=..>...
<option ..>...
...
</optgroup>
<optgroup ...>
<option ..>...
<option ..>...
...
默认值
...
...
...
...
...
...
您至少有两种选择:
您至少有两种选择:
您可以使用
Get List Items
返回所有项目的列表,然后使用Get Length
获取列表中的元素数:
Select Options Test
Open Browser your_url chrome
@{items} Get List Items id=select_list_id
${list_length} Get Length ${items}
Should Be True ${list_length} > 1
您可以使用
Get List Items
返回所有项目的列表,然后使用Get Length
获取列表中的元素数:
Select Options Test
Open Browser your_url chrome
@{items} Get List Items id=select_list_id
${list_length} Get Length ${items}
Should Be True ${list_length} > 1
我喜欢这个简单的答案!我喜欢这个简单的答案!谢谢你的回答,还有一个选择(在你编辑它之后)),它也非常有用。为你的时间赢得一些荣誉吧
:)
。感谢您提供了一个备选答案(在您编辑后)),该答案也非常有用。为你的时间赢得一些荣誉吧<代码>:)。
Select Options Test
Open Browser your_url chrome
@{items} Get List Items id=select_list_id
${list_length} Get Length ${items}
Should Be True ${list_length} > 1