public class Select extends CauliElement
| 构造器和说明 |
|---|
Select(IBrowser browser) |
Select(IBrowser browser,
CauliElement cauliElement) |
Select(IBrowser browser,
String location) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getComoboBoxSize()
获得控件里面的大小
|
org.openqa.selenium.support.ui.Select |
getSelect() |
int |
getSelectedIndex()
获得当前选中项的索引值
|
int[] |
getSelectedIndexs()
如果选择了多项,那么使用此方法可以获得多个选项的索引值
|
String |
getSelectedValue()
获得当前选中项的内容
|
String[] |
getSelectedValues()
如果选择了多项,那么使用此方法可以获得多个选项
|
void |
selectByIndex(int index)
根据comobobox中的索引值来进行选择,索引值从0开始的
|
void |
selectByRandomIndex()
通过随机数来获得select的option的项
|
void |
selectByValue(String value)
通过comobox中的内容进行选择,value属性值
|
void |
selectByVisiableText(String text)
通过comobobox标签之间的内容来进行选择
|
void |
setSelect(org.openqa.selenium.support.ui.Select select) |
void |
setSelectElement(org.openqa.selenium.WebElement element) |
assertAttribute, assertEditable, assertIsExist, assertNotEditable, assertSelected, assertText, assertValue, child, child, children, clear, click, contextClick, doubleClick, dragAndDrop, dragAndDrop, find, find, focus, getAttribute, getBrowser, getCssValue, getElement, getId, getLocate, getLocation, getSize, getTagName, getText, input, isDisplay, isEnable, isExist, isSelected, jquery, keyDown, keyPress, keyPress, keyUp, leftDown, leftUp, mouseOver, release, scroll, setElement, setId, setLocate, submitprivate org.slf4j.Logger logger
public org.openqa.selenium.support.ui.Select select
public Select(IBrowser browser)
public Select(IBrowser browser, CauliElement cauliElement)
public void setSelectElement(org.openqa.selenium.WebElement element)
public void setSelect(org.openqa.selenium.support.ui.Select select)
public void selectByIndex(int index)
index - 要选择的索引号public void selectByValue(String value)
value - 要选择项的内容public void selectByVisiableText(String text)
text - 要选择的项的内容值public int getSelectedIndex()
public String getSelectedValue()
public String[] getSelectedValues()
public int[] getSelectedIndexs()
public int getComoboBoxSize()
public void selectByRandomIndex()
public org.openqa.selenium.support.ui.Select getSelect()
Copyright © 2014. All rights reserved.