---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Element predicates

# Element predicates {#ariaid-title1}

Release version: Australia  
Updated June 25, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Element predicates are synchronous Boolean checks available in a Run UI Test Script step. Use them inside .find() or .filter() callbacks to pick one element from a list
based on its state.

## Element predicates {#r_run_ui_test_script_predicates__section_predicates}

These functions return `true` or `false` synchronously.

    // Find the first visible element with the text "Number"
    const labels = await screen.findAllByText(/^Number$/);
    const visible = labels.find(el => isVisible(el));

{#r_run_ui_test_script_predicates__section_predicates__entry__2}

| Predicate | Tests |
|-|-|
| isVisible(el) | Element is visible. |
| isHidden(el) | Element isn't visible. |
| isEnabled(el) | Form control is enabled. |
| isDisabled(el) | Form control is disabled or has `aria-disabled="true"`. |
| isChecked(el) | Check box or radio is checked. |
| isPartiallyChecked(el) | Check box is indeterminate. |
| isInDocument(el) | Element is connected to the document. |
| isEmpty(el) | Element has no child nodes. |
| hasFocus(el) | Element has keyboard focus. |
| hasClass(el, ...classes) | Element has all listed CSS classes. |
| hasAttribute(el, name, value?) | Element has the attribute, optionally with a value. |
| hasText(el, text) | Element's text content matches. |
| hasValue(el, value) | Form control's current value matches. |
| hasFormValues(el, values) | Form's field values match the given map. |
| hasRole(el, role) | Element has the given ARIA role. |
| hasStyle(el, styles) | Element has the given styles. |
| hasAccessibleName(el, name) | ARIA accessible name matches. |
| hasAccessibleDescription(el, desc) | ARIA accessible description matches. |
| containsElement(el, child) | `el` contains `child`. |
[Table 1. Element predicates]


