conditional-logic Scenario 1 — Wait for Maintenance Banner
Written by RTILA X Engineering Team
Beginner ~4 min
What You'll Learn
Use if/else branching based on element visibility
Real-World Use Case
Handling maintenance banners or pop-ups
LIVE DEMO
Maintenance Banner
Wait while the maintenance banner is visible, then extract the product table.
| Product | SKU | Price |
|---|---|---|
| Wireless Mouse | WM-100 | $24.99 |
| USB-C Hub | UC-210 | $39.99 |
| Mechanical Keyboard | MK-330 | $89.99 |
| 4K Monitor | MO-450 | $329.99 |
| Webcam | WB-560 | $59.99 |
EXPECTED OUTPUT
Maintenance Data
| product | sku | price |
|---|---|---|
| Wireless Mouse | WM-100 | $24.99 |
| USB-C Hub | UC-210 | $39.99 |
| Mechanical Keyboard | MK-330 | $89.99 |
| 4K Monitor | MO-450 | $329.99 |
| Webcam | WB-560 | $59.99 |
RTILA X PROJECT JSON
RTILA X Automation Project
wait-for-maintenance-banner.json
{
"name": "Wait_For_Maintenance_Banner",
"settings": {
"urls": [
"https://learn.rtila.com/scenarios/conditional-logic/1"
]
},
"datasets": {
"maintenance_data": {
"item_selector": "css=.data-table tbody tr",
"properties": [
{
"name": "product",
"type": "text",
"selector": "css=td:nth-child(1)"
},
{
"name": "sku",
"type": "text",
"selector": "css=td:nth-child(2)"
},
{
"name": "price",
"type": "text",
"selector": "css=td:nth-child(3)"
}
]
}
},
"commands": [
{
"command": "if",
"params": {
"condition": {
"type": "element_visible",
"selector": "css=.maintenance-banner"
},
"then": [
{
"command": "wait",
"params": {
"timeout": 60000
}
},
{
"command": "extract_data",
"params": {
"dataset": "maintenance_data"
}
}
],
"else": [
{
"command": "extract_data",
"params": {
"dataset": "maintenance_data"
}
}
]
}
}
]
} The if command checks for the maintenance banner. While it is visible, the automation waits and then extracts data from the page. Once the banner disappears, the else branch extracts the data immediately.
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 2 learning articles.
Continue Learning
Was this helpful?
Thank you for your feedback!