Actions57
- 1. Manager Actions
- 2. Mouse Actions
- 3. Keyboard Actions
- 4. Browser Control Actions
- 5. Element Actions
- 6. Image Actions
- 7. Others Actions
- 8. Email Actions
- 9. Developer Actions
- 10. General Debug Actions
5. Element → count_element
AI-generatedSummary
Publishes a request to a remote PyAutoGUI worker to count matching DOM elements via CSS selector or XPath, waiting for a count result before proceeding.
Inputs
- topic (required) — MQTT topic to publish the request to the remote client (e.g., WP2_PC176).
- Remote Port (required) — CDP port used to route the command to the correct browser session on the worker.
- Target — CSS selector for the element to count (e.g., css=button.submit).
- XPath — XPath expression for the element to count (e.g., //button[normalize-space()='Login']).
- QoS — MQTT Quality of Service level (0, 1, or 2).
- Include Input Items — Include data from the previous node in the request payload.
- Include Input Fields — Select specific fields from the previous node to include (e.g., id,name).
- Wait For Response — Block the workflow until the remote client returns the element count result.
- Response Timeout (sec) — Maximum time to wait for the response (minimum 1 second).
- Delay Next Step (ms) — Delay in milliseconds after publishing or receiving the response.
Output shape
A single item containing the element count in the .data.count field.
The result is returned only if 'Wait For Response' is enabled; otherwise, the workflow proceeds immediately. The remote worker determines the actual count based on the provided selector or XPath.
Examples
Example 1: Wait for element count to validate a list is fully loaded.
Set 'Wait For Response' to true, target a list container with CSS selector, and set a timeout.
Example 2: Count buttons on a page to trigger a workflow branch.
Set 'Wait For Response' to true, use XPath to count buttons, and set a timeout.
