Watir-webdriver gem supports all HTML elements from HTML Standard page. Watir and safariwatir gems support a subset of elements.
| Watir method | HTML tag | :action | :after? | :alt | :class | :css | :for | :href | :html | :id | :index | :method | :name | :src | :text | :title | :url |
:value | :xpath | Multiple Attributes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| area | <area> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| button | <button> <input type="button"> <input type="image"> <input type="reset"> <input type="submit"> | |
|
|
|
|
|
|
|
|
|
|
If the input type is image |
|
|
|
|
|
||
| cell | <td> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| checkbox | <input type="checkbox"> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| dd | <dd> | |||||||||||||||||||
| div | <div> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| dl | <dl> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| dt | <dt> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| em | <em> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| file_field | <input type="file"> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| form | <form> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| frame | <frame> <iframe> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| h1 h2 h3 h4 h5 h6 | <h1> <h2> <h3> <h4> <h5> <h6> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| hidden | <input type="hidden"> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| image | <img> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| label | <label> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| li | <li> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| link | <a> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| map | <map> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| p | <p> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| pre | <pre> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| radio | <input type="radio"> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| row | <tr> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| select_list | <select> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| span | <span> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| strong | <strong> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| table | <table> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| tbody | <tbody> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| text_field | <input type="password"> <input type="text"> <textarea> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| ul | <ul> | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
| New Browser Windows | n/a | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Comments (2)
Jan 23, 2012
Kevin Petry says:
Missing element in the above list is <section>Blah blah</section> b...Missing element in the above list is <section>Blah blah</section>
browser.section(:id,'elementID') is a valid construct in this example:
browser.section(:id,'elementID').links
Tested in Watir-Webdriver
Jan 24, 2012
Zeljko says:
This page will soon be replaced with something like this: http://zeljkofilipin.g...This page will soon be replaced with something like this: http://zeljkofilipin.github.com/watirbook/reference/elements.htm