Watir Web-Driver 的button对象

上一篇 / 下一篇  2013-01-21 16:24:12 / 个人分类:测试

作为button来处理的对象有:

<button>
<input type="button">
<input type="image">
<input type="reset">
<input type="submit">


可以用来定位button的方法有:

:alt 别名
:class 类名
:id   id号
:index   索引号
:name 名字
:src 源(image button only)
:text 文本
:value
:xpath xpath路径
multiple 混合方式


通用的方法有:

== 是否相等
attribute_value  返回指定属性的值
browser 返回所在browser对象
click 左键单击
double_click 左键双击
drag_and_drop_by 拖拽到指定区域
drag_and_drop_on 拖拽到指定元素上
driver 返回所用的driver
enabled? 是否可以点击
exists? 是否存在
fire_event 执行指定的事件
flash 高亮该button
focus 焦点移至该button上
focused? 焦点是否在button上
hash 返回该button的hash值
hover 鼠标悬浮在该button上
html 返回该button的html内容
inspect 返回该button的inspect值
parent 返回该button的父节点
present? 是否存在并可见
right_click 右键点击一次
run_checkers 返回正在运行的checker列表
style 返回button的style值
tag_name 返回button的tag值
text 返回button的text值 (button类型使用)
to_subtype 返回button的类型
value 返回button的value值 (input类型使用)
visible? 是否可见
wd 返回该button的driver值
wait_until_present 出现前等待
waith_while_present 消失前等待
when_present 出现前等待

例如:

browser.button(:id => 'foo').when_present.click


TAG:

 

评分:0

我来说两句

日历

« 2024-05-01  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 151467
  • 日志数: 185
  • 文件数: 6
  • 建立时间: 2007-08-06
  • 更新时间: 2015-01-06

RSS订阅

Open Toolbar