check_condition
Check the current state of an element or text, returning true or false for presence or visibility without waiting for conditions to change.
Instructions
Check the current state of an element or text without waiting for the condition to become true.
Use this tool when you need an immediate boolean observation of the current page state. Use wait_for when the condition may become true later and the workflow should wait for it. Use assert_condition when the condition is an expected requirement and failure should be treated as an assertion error.
Args:
check:
The element state to inspect when text is not provided:
- "present": Return True when at least one matching element exists.
- "visible": Return True when the matching element is visible.
Defaults to "visible".
check is ignored when text is provided.
selector:
CSS selector or SeleniumBase selector identifying the element to
inspect. Defaults to "body". When `text` is provided, this also
identifies the element whose visible text is checked.
text:
Optional text to check for visibility within `selector`. When
provided, this takes precedence over `check`; the tool checks text
visibility instead of element presence or visibility. Use this when
the question is "Is this text currently visible?" rather than
whether the element itself is present or visible.Returns: True or False indicating whether the requested condition is currently satisfied. Missing elements return False rather than raising an exception.
Tool selection: - Immediate boolean observation -> use check_condition. - Wait for an element or text condition to become true/false -> use wait_for. - Verify an expected condition and fail when it is not met -> use assert_condition. - Need the number or details of matching elements -> use find_elements. - Need to read the actual page or element content -> use get_content.
Notes: This tool does not intentionally wait for elements or text to appear. It is intended for checking the current state only. If page timing or asynchronous loading matters, use wait_for instead.
When `text` is provided, `check` is ignored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| check | No | visible | |
| selector | No | body |