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

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)

Radio元素

HTML tag - <input type=”radio”>

 

可以用來定位的方法有:

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

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

Browser.radio(:index,  0)

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

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

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

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

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

 

Tr元素

HTML tag - <tr>

 

可以用來定位的方法有:

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

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

Browser.tr(:index,  0)

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

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

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

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

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