如何在 Watir 中识别各种 HTML 对象(5)

上一篇 / 下一篇  2013-01-14 17:51:04 / 个人分类:测试

Link元素

HTML tag - <link>

 

可以用来定位的方法有:

Browser.link(:after?, “after link”)

Browser.link(:class,  “link class”)

Brower.link(:href, “link href”

Browser.link(:id,  “link id”)

Browser.link(:index,  0)

Browser.link(:name,  “link name”)

Browser.link(:text,  “link text”)

Browser.link(:xpath,  “link xpath”)

Browser.link(:class=>“link class name”,  :index, 0) (Mulitple Attributes)

 

Map元素

HTML tag - <map>

 

可以用来定位的方法有:

Browser.map(:class,  “map class”)

Browser.map(:id,  “map id”)

Browser.map(:index,  0)

Browser.map(:name,  “map name”)

Browser.map(:text,  “map text”)

Browser.map(:xpath,  “map xpath”)

Browser.map(:class=>“map class name”,  :index, 0) (Mulitple Attributes)

 

P元素

HTML tag - <p>

 

可以用来定位的方法有:

Browser.paragraph(:class,  “paragraph class”)

Browser.paragraph(:id,  “paragraph id”)

Browser.paragraph(:index,  0)

Browser.paragraph(:name,  “paragraph name”)

Browser.paragraph(:text,  “paragraph text”)

Browser.paragraph(:xpath,  “paragraph xpath”)

Browser.paragraph(:class=>“paragraph class name”,  :index, 0) (Mulitple Attributes)

 

Pre元素

HTML tag - <pre>

 

可以用来定位的方法有:

Browser.pre(:class,  “pre class”)

Browser.pre(:id,  “pre id”)

Browser.pre(:index,  0)

Browser.pre(:name,  “pre name”)

Browser.pre(:text,  “pre text”)

Browser.pre(:xpath,  “pre xpath”)

Browser.pre(:class=>“pre class name”,  :index, 0) (Mulitple Attributes)


TAG:

 

评分:0

我来说两句

日历

« 2024-05-03  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

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

RSS订阅

Open Toolbar