2024年3月25日发(作者:)

一. 文本框Text box

1. 向文本框中填写信息

type( locator, value)

("salutationText", “abc”);

2. 取出某个文本框中已经填写的信息

getValue( locator)

ue("xpath=//input[@name='addProfileLastName']");

3. 判断某文本框是否可编辑

booleanisEditable( locator)

able("xpath=//input[@name='addProfileLastName']");

二.下拉框 Drop down list

1. 向下拉框中选值

select(selectLocator, optionLocator)

("typeSelect", "label=Date");

2. 取出某个下拉框中已经选择的值

getSelectedLabel(selectLocator)

eg. ectedLabel("xpath=//SELECT[@name='addSatution']")

3. 取出某个下拉框中所有的选项

[]getSelectOptionsgetSelectOptionsgetSelectOptions(sele

ctLocatogetSelectOptionsr)

eg. ectOptions("//div[@id='mysearch_tips']/select")

三.按钮或链接Button & Link

单击

click( locator)

eg. ("link=Administration");

("xpath=//input[@checkfield='addIndicatorName' and

@name='addBtn']");

四.单选框或多选框 Radio Box & Check Box

1. 选择

check( locator)

eg. ("otherPhoneFlag");

1. 不选

uncheck( locator)

eg. k("otherPhoneFlag");

2. 判断是否选择

booleanisChecked( locator)

eg. ked("otherPhoneFlag");

五.表格Table

1. 取出表中某个单元格的值,下标从 0 开始

getTable(tableCellAddress)

eg. le("//div[@id='profiles-search']/div[2]/table.1.1");

六.其他其他其他其他others

1. 取某个元素的特定属性值

getAttribute(attributeLocator)

eg. ribute("xpath=//img[@name='picName']@style")

2.取某元素的 text 值