check_for_condition
Inspect the current state of an element or page immediately. Returns boolean status for presence, visibility, or visible text, or an integer count of matching elements, without waiting for conditions.
Instructions
Immediately inspect the current state of an element or page.
Use this tool when you need an observation of the current state and do NOT want to wait for a condition. For waiting behavior, use wait_for. For an expectation that should fail as an assertion, use assert_condition.
Args: check: - "present": Return whether at least one matching element exists. - "visible": Return whether the matching element is visible. - "count": Return the number of matching elements. This check may wait up to 1 second for a match. - "text_visible": Return whether the specified text is visible within the selected element. Requires text. selector: CSS selector or SeleniumBase selector for the element. Defaults to "body". text: Text to check when check="text_visible".
Returns: A boolean for present/visible/text_visible, or an integer count for count. Missing elements do not cause an exception for these checks.
Tool selection: - Immediate yes/no/count observation -> use check_for_condition. - Wait until a state becomes true/false -> use wait_for. - Verify an expected condition and fail when it is not met -> use assert_condition.
Note: Except for count's short lookup, this tool does not wait for elements to appear. Use wait_for when page timing matters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| check | No | visible | |
| selector | No | body |