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

Select_list元素

HTML tag - <select>

 

可以用來定位的方法有:

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

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

Browser.select(:index,  0)

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

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

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

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

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

Span元素

HTML tag - <span>

 

可以用來定位的方法有:

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

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

Browser.span(:index,  0)

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

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

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

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

Table元素

HTML tag - <table>

 

可以用來定位的方法有:

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

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

Browser.table(:index,  0)

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

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

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

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

 

Text_field元素

HTML tag - <input type=”password”>/<input type=”text”>

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