您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Watir
如何在 Watir 中識別各種 HTML 對象
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2014/3/6 13:23:24 ] 推薦標簽:Watir HTML 對象

可以用來定位的方法有:

Browser.form(:action, “form. action”)

Browser.form(:class,  “file class”)

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

Browser.form(:index,  0)

Browser.form(:method,  “form. method”)

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

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

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

 

Frame元素

HTML tag - <frame>/<iframe>

 

可以用來定位的方法有:

Browser.frame(:id,  “frame. id”)/

Browser.frame(:index,  0)

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

Browser.frame(:src,  “frame. src”)

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

Browser.frame(:id=>“frame. id”,  :index, 0) (Mulitple Attributes)


空間管理 您的位置: 51Testing軟件測試網(wǎng) » 龍族守護神 » 日志 
如何在 Watir 中識別各種 HTML 對象(4)

上一篇 / 下一篇  2013-01-14 17:49:50 / 個人分類:測試
查看( 120 ) / 評論( 0 ) / 評分( 0 / 0 )

Head元素

HTML tag - <h1><h2><h3><h4><h5><h6>

 

可以用來定位的方法有:

Browser.head(:class,  “heading class”)

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

Browser.head(:index,  0)

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

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

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

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

 

Hidden元素

HTML tag - <hidden>

 

可以用來定位的方法有:

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

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

Browser.hidden(:index,  0)

Browser.hidden(:method, “hidden method”)

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

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

Browser.hidden(:value, “hidden value”)

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

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

 

Image元素

HTML tag - <img>

上一頁1234567下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd