This repository has been archived by the owner on Jun 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
HTML Elements Supported by Watir
wuleicanada edited this page Jul 17, 2014
·
5 revisions
Watir supports all (or most) HTML elements from HTML Standard page.
The below table summarizes some of the more common element types and locators.
Watir method | HTML tag | :class | :css | :for | :href | :id | :index | :name | :src | :text | :value | :xpath |
---|---|---|---|---|---|---|---|---|---|---|---|---|
button | <button> <input type="button"> <input type="image"> <input type="reset"> <input type="submit"> | Yes | No | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
checkbox | <input type="checkbox"> | Yes | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | |
div | <div> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
file_field | <input type="file"> | Yes | No | No | Yes | Yes | Yes | No | No | Yes | Yes | |
frame | <frame> <iframe> | No | No | No | Yes | Yes | Yes | Yes | Yes | No | No | |
h1 h2 h3 h4 h5 h6 | <h1> <h2> <h3> <h4> <h5> <h6> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
hidden | <input type="hidden"> | Yes | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | |
image | <img> | Yes | Yes | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
label | <label> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
li | <li> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
link | <a> | Yes | No | Yes | Yes | Yes | Yes | No | Yes | No | Yes | |
p | <p> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
radio | <input type="radio"> | Yes | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | |
select_list | <select> | Yes | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | |
span | <span> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
table | <table> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
td | <td> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
tr | <tr> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes | |
textarea | <textarea> | Yes | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | |
text_field | <input type="password"> <input type="text"> <textarea> | Yes | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | |
ul | <ul> | Yes | No | No | Yes | Yes | Yes | No | Yes | No | Yes |