Wait Element
Waits for an element to appear or disappear in a web page
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Page Id - ID of the page where the element is located. This ID is generated by the Open Browser node.
- Selector Type - Type of selector used to find the element.
- Selector - Selector used to find the element.
Options
- Condition - Determines whether to wait for the element to appear, disappear, or appear and then disappear.
- Timeout (sec) - Maximum time that the node waits for the element to appear or disappear, in seconds.
How It Works
- The node receives the Page ID, Selector Type, Selector, Condition, and Timeout
- It validates that Page ID, Selector, Timeout, and Condition are not empty
- It waits for any configured delay before execution
- It retrieves the active page session using the provided Page ID
- Based on the Condition selected:
- To Appear: Waits until the element appears on the page
- To Disappear: Waits until the element is removed from the page
- Appear and Disappear: Waits for the element to appear, then waits for it to disappear
- For Safari browsers, it uses a specialized Safari-specific waiting mechanism
- For other browsers, it uses the standard element waiting mechanism
- The node polls the page at intervals checking for the element state
- If the condition is met within the timeout, the node completes successfully
- If the timeout is reached before the condition is met, the node fails
- The node applies any configured delay after execution
Requirements
- An active browser session created by the Open Browser node
- A valid Page ID from the Open Browser node
- A valid CSS or XPath selector that identifies the target element
- A valid Condition selected (To Appear, To Disappear, or Appear and Disappear)
- A Timeout value greater than zero
Error Handling
| Error Code | Description |
|---|---|
| Core.Browser.WaitElement.ErrOnCreate | Configuration parsing error during node creation |
| Core.Browser.WaitElement.ErrOnMessage | Error parsing incoming message data |
| Core.Browser.WaitElement.ErrPageId | Page ID is empty or not provided |
| Core.Browser.WaitElement.ErrSession | Invalid or expired Page ID, session not found |
| Core.Browser.WaitElement.ErrSelector | Selector is empty or not provided |
| Core.Browser.WaitElement.ErrNoTimeout | Timeout is not set or is zero |
| Core.Browser.WaitElement.ErrNoCondition | Condition is not selected |
| Core.Browser.WaitElement.ErrFailed | Element condition not met within timeout period |
Usage Examples
Example 1: Waiting for Loading Spinner to Disappear
When waiting for page content to load after an action:
1. Use Open Browser and navigate to a page
2. Click a button that triggers data loading
3. Use Wait Element with:
- Selector Type: CSS
- Selector: .loading-spinner
- Condition: To Disappear
- Timeout: 30 seconds
4. Once spinner disappears, page content is loaded
5. Continue with data extraction or next actions
Example 2: Waiting for Dynamic Content
When content loads asynchronously after page load:
1. Navigate to a page with AJAX content
2. Use Wait Element with:
- Selector Type: XPath
- Selector: //div[@id='dynamic-content']
- Condition: To Appear
- Timeout: 20 seconds
3. Once element appears, it's safe to interact with it
4. Use Get Value or Click Element on the loaded content
Example 3: Flash Message Handling
When handling temporary notification messages:
1. Perform an action that shows a success message
2. Use Wait Element with:
- Selector Type: CSS
- Selector: .flash-message
- Condition: Appear and Disappear
- Timeout: 10 seconds
3. Wait for message to appear and then disappear
4. Continue with next automation step
Usage Notes
- Wait Element is essential for handling dynamic content and asynchronous page updates
- The node polls the page state at regular intervals during the wait period
- For "To Appear" condition, the element must be present in the DOM and visible
- For "To Disappear" condition, the element must be completely removed from the DOM or hidden
- "Appear and Disappear" waits for both conditions sequentially
- Timeout should be set generously for slow-loading content
- The node blocks execution until the condition is met or timeout occurs
- Use this node before interacting with dynamically loaded elements
- For Safari browsers, the implementation differs slightly from other browsers
Tips
- Always use Wait Element before interacting with dynamic elements
- Set realistic timeouts based on expected load times (add buffer for slow networks)
- For very slow loading pages, consider increasing timeout significantly
- Use "To Disappear" for loading indicators, overlays, and spinners
- Use "To Appear" for content that loads after page load or user actions
- Combine multiple Wait Element nodes for complex loading sequences
- Test with slow network conditions to determine appropriate timeouts
- Consider using Continue On Error if the element's presence is optional
- Use Wait Element after navigation, clicking, or form submission when content changes
Related Nodes
- Open Browser - Creates the browser session and Page ID
- Click Element - Clicks elements after waiting for them
- Get Value - Extracts values after waiting for elements
- Type Text - Types into elements after waiting
- Refresh - May be used before waiting for elements to reload