--- title: screen — DOM queries description: The screen API is the primary interface for finding elements on the page tested by a Run UI Test Script step. All query methods pierce shadow roots automatically, so they work with Now Experience components as well as classic Jelly and UI16 pages. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/developer-guides/r\_run\_ui\_test\_script\_screen.html release: australia product: Developer Guides classification: developer-guides topic_type: reference last_updated: "2026-06-25" reading_time_minutes: 2 keywords: [screen, DOM queries, getByRole, findByText, shadow DOM, Run UI Test Script] breadcrumb: [Run UI Test Script Developer Guide, Developer guides, API implementation and reference] --- # screen — DOM queries The screen API is the primary interface for finding elements on the page tested by a Run UI Test Script step. All query methods pierce shadow roots automatically, so they work with Now Experience components as well as classic Jelly and UI16 pages. ## Query method variants Each query type comes in the following variants. |Variant|Returns|Throws when missing?|Async?| |-------|-------|--------------------|------| |`getBy*`|Single element|Yes, throws immediately|No| |`getAllBy*`|Array of elements|Yes, if empty|No| |`queryBy*`|Single element or `null`|No|No| |`queryAllBy*`|Array, which may be empty|No|No| |`findBy*`|Single element|Yes, rejects the Promise|Yes, polls until found| |`findAllBy*`|Array of elements|Yes, if empty|Yes, polls until found| Use `findBy*` when the element appears asynchronously, such as after an API response, animation, or navigation. Use `getBy*` when the element must already exist. Use `queryBy*` to check whether an element is absent. ## Query types Each variant supports the following query types. |Type|Finds elements by|Example| |----|-----------------|-------| |`Role`|ARIA role, implicit or explicit|`screen.getByRole('button', { name: 'Save' })`| |`Text`|Visible text content|`screen.findByText('Incident created')`| |`LabelText`|Associated `