dynamic-content Scenario 5 — Wait for WebSocket Update
Written by RTILA X Engineering Team
Advanced ~10 min
Prerequisites: dynamic-content/3 dynamic-content/4
What You'll Learn
Combine multiple dynamic loading strategies
Real-World Use Case
Extracting data from complex single-page apps
LIVE DEMO
WebSocket Update
Wait for the WebSocket message that updates the account table.
Waiting for WebSocket update...
EXPECTED OUTPUT
WebSocket Data
| field | value |
|---|---|
| Account ID | ACC-2001 |
| Plan | Pro Annual |
| Status | Updated |
RTILA X PROJECT JSON
RTILA X Automation Project
wait-for-websocket-update.json
{
"name": "Wait_For_WebSocket_Update",
"settings": {
"urls": [
"https://learn.rtila.com/scenarios/dynamic-content/5"
]
},
"datasets": {
"ws_data": {
"item_selector": "css=table.ws-data-table tr",
"properties": [
{
"name": "field",
"type": "text",
"selector": "css=td:nth-child(1)"
},
{
"name": "value",
"type": "text",
"selector": "css=td:nth-child(2)"
}
]
}
},
"commands": [
{
"command": "wait_for_selector",
"params": {
"selector": "css=.ws-content",
"timeout": 15000
}
},
{
"command": "extract_data",
"params": {
"dataset": "ws_data"
}
}
]
} WebSocket updates are asynchronous and may arrive after the page load. Using wait_for_selector on the new content element ensures extraction occurs only after the update is visible.
Did you complete this scenario?
Ready to run this automation?
Copy the project JSON above, open RTILA X, create a new project, and paste it.
This scenario covers 2 RTILA X commands and is referenced in 1 learning article.
Continue Learning
Was this helpful?
Thank you for your feedback!