Watir Web-driver 支持的 HTML elements 如下所列:
list
array
Area元素
HTML tag - <area>
可以用來定位的方法有:
Browser.area(:class, “area class name”)
Browser.area(:id, “area id”)
Browser.area(:index, 0)
Browser.area(:name, “area name”)
Browser.area(:text, “area text”)
Browser.area(:xpath, “area xpath”)
Browser.area(:class=>“area class name”, :id=>“area id”, :index, 0) (Mulitple Attributes)
Button元素
HTML tag - <button>/<input type=”button”>/<input type=”image”>/<input type=”reset”>
/<input type=”submit”>
可以用來定位的方法有:
Browser.button(:alt, “alt button name”)
Browser.button(:class, “button class”)
Browser.button(:id, “button id”)
Browser.button(:index, 0)
Browser.button(:name, “button name”)
Browser.button(:src, “image button src”) (only for type is image)
Browser.button(:text, “button text”)
Browser.button(:value, “button default value”)
Browser.button(:xpath, “button xpath”)
Browser.button(:class=>“button class name”, :id=>“button id”, :index, 0) (Mulitple Attributes)