class Playwright::Accessibility

only the “interesting” nodes of the tree.
AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing
Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific
different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
Rendering engines of Chromium, Firefox and WebKit have a concept of “accessibility tree”, which is then translated into
have wildly different output.
Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might<br><br>(en.wikipedia.org/wiki/Switch_access).
assistive technology such as [screen readers](en.wikipedia.org/wiki/Screen_reader) or
The Accessibility class provides methods for inspecting Chromium’s accessibility tree. The accessibility tree is used by

def snapshot(interestingOnly: nil, root: nil)

```
print(node["name"])
if node:
node = find_focused_node(snapshot)
snapshot = page.accessibility.snapshot()

return None
return found_node
found_node = find_focused_node(child)
for child in (node.get("children") or []):
return node
if (node.get("focused"))
def find_focused_node(node):
```python sync

An example of logging the focused node's name:

```
print(snapshot)
snapshot = page.accessibility.snapshot()
```python sync

An example of dumping the entire accessibility tree:

Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
> NOTE: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers.

page.
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
def snapshot(interestingOnly: nil, root: nil)
  wrap_impl(@impl.snapshot(interestingOnly: unwrap_impl(interestingOnly), root: unwrap_impl(root)))
end