Loop Recording
Loop Recording lets you record a sequence of actions once, then tell RTILA X to repeat those actions multiple times or under specific conditions. Instead of recording the same steps over and over, you record them once and define how they should repeat.
This is perfect for tasks like scraping multiple pages of search results, filling out the same form with different data, or processing a list of items one by one.

When to Use Loop Recording
Section titled “When to Use Loop Recording”Loop recording is ideal for any task that involves repetition:
| Use Case | Example |
|---|---|
| Scraping multiple pages | Scrape page 1, click “Next”, scrape page 2, repeat for 10 pages. |
| Filling forms repeatedly | Fill a form with data from a list, submit, repeat for each entry. |
| Processing search results | Click each search result, extract data, go back, repeat. |
| Batch operations | Perform the same action on multiple items in a list. |
| Pagination scraping | Navigate through paginated content, extracting data from each page. |
| Multi-step workflows | Record a multi-step workflow once and repeat it for each item in a dataset. |
Starting a Loop Recording
Section titled “Starting a Loop Recording”Prerequisites
Section titled “Prerequisites”- Recording must already be active (the red recording indicator must be visible).
- You must be on the page where you want to begin the loop actions.
Steps to Start a Loop
Section titled “Steps to Start a Loop”- Start a recording (see Auto-Recording if you haven’t already).
- Navigate to the page where your loop actions should begin.
- On the recording indicator bar, click the “Start Loop” button.
- The indicator text changes to “Recording Loop Actions… 🔁” and the loop button changes to “Stop Loop” (orange).
- Perform the actions you want to repeat. These are the actions that will loop.
- When you’ve finished the actions for one iteration, click “Stop Loop”.
Important: Only the actions performed between clicking “Start Loop” and “Stop Loop” are captured as loop content. Actions before “Start Loop” are recorded as regular (non-looping) commands.
Configuring the Loop
Section titled “Configuring the Loop”After clicking “Stop Loop”, a Loop Configuration modal appears. This is where you define how the recorded actions should repeat.

Loop Types
Section titled “Loop Types”The modal presents three loop types. Choose the one that matches your use case:
Type 1: Repeat Fixed Number of Times
Section titled “Type 1: Repeat Fixed Number of Times”This is the simplest loop type. The recorded actions repeat a specific number of times.
| Setting | Description | Example |
|---|---|---|
| Number of Iterations | How many times to repeat the loop actions. | 5 = repeat 5 times |
Use when: You know exactly how many times the actions need to repeat. For example, “scrape the next 10 pages” or “fill this form 5 times.”
Example:
- You record: Click “Next Page” → Extract data → Wait for load.
- Set iterations to
10. - Result: RTILA repeats those 3 actions 10 times, scraping 10 pages total.
Type 2: While Element Is Visible
Section titled “Type 2: While Element Is Visible”This loop type repeats the actions as long as a specific element is visible on the page. When the element disappears or becomes hidden, the loop stops.
| Setting | Description | Example |
|---|---|---|
| Element Selector | The CSS selector of the element to check. The loop continues while this element is visible. | css=.next-page-button |
Use when: You don’t know how many iterations are needed, but you know when to stop. For example, “keep clicking ‘Next’ while the Next button is visible.”
Example:
- You record: Click “Next Page” → Extract data → Wait for load.
- Set condition selector to
css=.next-page-button. - Result: RTILA repeats the actions as long as the “Next Page” button is visible. When there are no more pages, the button disappears and the loop stops automatically.
Tip: Use a selector that reliably indicates whether more iterations are needed. A “Next” button that disappears on the last page is a perfect condition element.
Type 3: For Each Item in List/Dataset
Section titled “Type 3: For Each Item in List/Dataset”This is the most powerful loop type. It iterates over a list of items, performing the recorded actions once for each item.
| Setting | Description | Example |
|---|---|---|
| Source Type | Where the items come from: a List Variable or an Extracted Dataset. | List Variable |
| Variable Name | (For List Variable) The name of the variable containing the items. | keywords |
| Dataset Name | (For Extracted Dataset) The name of a previously extracted dataset. | primary |
| Assign to loop variable (as) | The variable name that holds the current item during each iteration. | item |
Use when: You need to perform the same actions for each item in a list. For example, “for each product in my dataset, visit its page and extract details.”
Example:
- You have a dataset called
productscontaining product URLs. - You record: Go to product URL → Extract details → Go back.
- Set source to “Extracted Dataset”, dataset name to
products, iterator name toproduct. - Result: RTILA iterates through each product in the dataset, visiting each product page and extracting details.
How Loops Appear in the Command List
Section titled “How Loops Appear in the Command List”After configuring and saving a loop, it appears as a single loop command in the Web Automation tab, containing all the recorded actions as nested commands.
For “Repeat Fixed Number of Times”
Section titled “For “Repeat Fixed Number of Times””The loop appears as a repeat command:
repeat (5 times)├── click (css=.next-button)├── wait_for_load_state└── extract_data (products)For “While Element Is Visible”
Section titled “For “While Element Is Visible””The loop appears as a while command:
while (css=.next-page-button is visible)├── click (css=.next-button)├── wait_for_load_state└── extract_data (products)For “For Each Item in List/Dataset”
Section titled “For “For Each Item in List/Dataset””The loop appears as a for_each command:
for_each (dataset: products, as: product)├── goto (${product.url})├── extract_data (product_details)└── go_back
Editing Loops
Section titled “Editing Loops”Loops can be edited just like any other command:
Editing Loop Parameters
Section titled “Editing Loop Parameters”- Open the project in the Visual Builder.
- Switch to the Web Automation tab.
- Click on the loop command to expand it.
- Edit the loop parameters:
- For
repeat: Change the number of iterations. - For
while: Change the condition selector. - For
for_each: Change the source type, variable/dataset name, or iterator name.
- For
Editing Nested Commands
Section titled “Editing Nested Commands”- Click the loop command to expand it.
- Click the toggle visibility button (eye icon) to show nested commands.
- Click any nested command to edit its parameters.
- You can also add new commands inside the loop or delete existing ones.
Changing Loop Type
Section titled “Changing Loop Type”You cannot directly change a loop’s type (e.g., from repeat to while). To change the loop type:
- Delete the existing loop command.
- Re-record the loop actions with the new loop type.
Loop Variables
Section titled “Loop Variables”When using the “For Each Item in List/Dataset” loop type, the current item is available as a variable inside the loop. By default, this variable is called item, but you can rename it using the “Assign to loop variable (as)” field.
Referencing the Loop Variable
Section titled “Referencing the Loop Variable”Use the ${variable_name} syntax to reference the current item:
${item}Example: Using Loop Variables
Section titled “Example: Using Loop Variables”If you have a dataset called products with properties name, url, and price:
for_each (dataset: products, as: product)├── goto (${product.url}) ← Navigate to each product's URL├── extract_data (product_details) ← Extract details from the product page├── set_variable (current_name, ${product.name}) ← Save the product name└── go_back ← Go back to the listing pageUsing Loop Variables with List Variables
Section titled “Using Loop Variables with List Variables”If you have a list variable called keywords with values:
web scrapingdata extractionbrowser automationAnd a for_each loop with as: keyword:
for_each (variable: keywords, as: keyword)├── goto (https://example.com/search?q=${keyword})├── extract_data (search_results)└── wait (2000)RTILA will iterate through each keyword, searching for each one and extracting results.
CSV List Variables
Section titled “CSV List Variables”If your list variable contains semicolon-separated values (CSV format):
john;admin;user1jane;editor;user2bob;viewer;user3You can access individual columns using JavaScript:
${item.split(';')[0].trim()} → "john"${item.split(';')[1].trim()} → "admin"${item.split(';')[2].trim()} → "user1"Tip: The right-click context menu in the Visual Builder automatically detects CSV columns and offers them as insertion options. Right-click on any input field and choose Insert Variable to see available columns.
Warning: Stopping Recording During an Active Loop
Section titled “Warning: Stopping Recording During an Active Loop”If you try to stop the main recording while a loop recording is still active, RTILA X shows a warning:
“Loop Recording Active” You are currently inside an active Loop Recording session. Please click the Stop Loop button on the recording indicator first before you stop the main recording.
This prevents incomplete loop recordings. You must:
- Click “Stop Loop” on the recording indicator.
- Configure the loop in the modal that appears.
- Then you can stop the main recording.
Loop Recording Workflow: Complete Example
Section titled “Loop Recording Workflow: Complete Example”Here’s a complete example of using loop recording to scrape multiple pages of search results:
Scenario
Section titled “Scenario”You want to scrape product listings from an e-commerce site with pagination (10 pages of results).
- Start recording — Click Record in the ribbon.
- Navigate to the search page — Type the search URL in the address bar.
- Click “Start Loop” — The indicator changes to “Recording Loop Actions… 🔁”.
- Perform the loop actions:
- Extract product data from the current page.
- Click the “Next Page” button.
- Wait for the page to load.
- Click “Stop Loop” — The loop configuration modal appears.
- Configure the loop:
- Choose “While Element Is Visible”.
- Set the selector to
css=.next-page-button.
- Click “Save Loop” — The loop is saved as a
whilecommand. - Stop the main recording — Press
Alt+Shift+X. - Review and save — Open the side panel, verify the commands, and save.
Result
Section titled “Result”Your project now contains:
goto (https://example.com/search?q=products)while (css=.next-page-button is visible)├── extract_data (products)├── click (css=.next-page-button)└── wait_for_load_stateWhen you run this project, RTILA will:
- Navigate to the search page.
- Extract product data.
- Click “Next Page”.
- Repeat steps 2–3 as long as the “Next Page” button is visible.
- Stop when there are no more pages.
Tips for Effective Loop Recording
Section titled “Tips for Effective Loop Recording”| Tip | Why It Matters |
|---|---|
| Keep loop actions minimal | Record only the actions needed for one iteration. Extra actions slow down the loop. |
| Use reliable condition selectors | For while loops, choose a selector that reliably indicates when to stop. |
| Add waits inside loops | Add wait commands between actions to give pages time to load between iterations. |
| Test with a small iteration count | When using repeat, test with 2–3 iterations first before increasing the count. |
| Use datasets for complex loops | For for_each loops, extract a dataset first, then loop through it. |
| Add error handling | Wrap risky loop actions in try_catch blocks to handle errors gracefully. |
| Monitor loop progress | Watch the execution logs to verify the loop is progressing correctly. |
Troubleshooting Loop Recording
Section titled “Troubleshooting Loop Recording”| Problem | Solution |
|---|---|
| “Start Loop” button doesn’t appear | Make sure recording is active. The button only appears while recording. |
| Loop captures too many actions | Click “Stop Loop” sooner. Only actions between “Start Loop” and “Stop Loop” are captured. |
| Loop condition never triggers | Check the selector. Make sure the element is visible when the loop should continue. |
| Loop runs forever | Add a max_scrolls limit or use a repeat loop with a fixed count instead. |
| Loop variable is empty | Check the source variable/dataset name. Make sure it exists and contains data. |
| Loop doesn’t iterate through all items | Check the dataset or variable contains all expected items. Verify the iterator name matches. |