getByRole("指定するキーワード")で取得可能。
属性が複数存在する場合はgetAllByRole("指定するキーワード")で取得する。
| 属性 | 指定するキーワード |
|---|---|
| article | article |
| button | button |
| td | cell, gridcell |
| input(type=checkbox) | checkbox |
| input(type=radio) | radio |
| input(type=search) | searchbox |
| input(type=text) | textbox |
| th | columnheader |
| select | combobox, listbox |
| menuitem | command, menuitem |
| dd | definition |
| figure | figure |
| form | form |
| table | grid, table |
| fieldset | group |
| h1 ~ h6 | heading |
| img | img |
| a | link |
| link | link |
| ol, ul | list |
| li | listitem |
| nav | navigation |
| option | option |
| frame | region |
| rel | roletype |
| tr | row |
| tbody, tfoot, thead | rowgroup |
| hr | separator |
| dt, dfn | term |
| textarea | textbox |
aタグはhref属性が無いと反応しない?要検証、、、