Select From List 下拉列表框定位


Select From List还有Select From List By xxx,xxx包括Index、Label和Value,以下是我整理了最近用到的关键字:


Select From List By Value的用法:

Name:  Select From List By Value

Source:Selenium2Library

Arguments:[ locator | *values ]

Value是选项的值,在源码里才能看的,比如第一个选项的value="item1",


Select From List 下拉列表框定位_第1张图片



Select From List By Index的用法:

Name:  Select From List By Value

Source:Selenium2Library

Arguments:[ locator | *values ]

Index是从0开始的,也就是说选择第一个选项的话,要用0;

Select From List 下拉列表框定位_第2张图片

Select From List 下拉列表框定位_第3张图片



Select From List By Label的用法:

Name: Select From List By Label

Source: Selenium2Library
Arguments: [ locator | *labels ]

如果你想用“第一个元素”来选择选项,前面的关键字要用By Label;

你可能感兴趣的:(Robot,Framework)