Navigation Commands
Navigation commands control which page the browser is on. They allow you to move between pages, go back and forward in history, reload pages, and switch between browser tabs.
Navigates to a specific URL.
Description
Section titled “Description”The goto command tells the browser to navigate to a specific URL. This is typically the first command in any automation, as it tells RTILA where to start.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url |
String | Yes | — | The URL to navigate to. Supports ${variable} substitution. |
Example
Section titled “Example”{ "command": "goto", "params": { "url": "https://example.com/products" }}With variable substitution:
{ "command": "goto", "params": { "url": "https://example.com/search?q=${search_term}" }}Behavior Notes
Section titled “Behavior Notes”- The navigation timeout is controlled by the project’s
navigation_timeoutsetting (default: 30000ms / 30 seconds). - The command waits for the
domcontentloadedevent before proceeding. - If CAPTCHA solving is enabled, RTILA will attempt to solve any CAPTCHA that appears after navigation.
- If
respect_robots_txtis enabled, RTILA will check the site’s robots.txt before navigating and skip the navigation if the URL is disallowed.
Edge Cases
Section titled “Edge Cases”- If the URL is invalid or unreachable, the command will fail and the automation will stop (unless wrapped in a
try_catch). - If the page takes longer than the navigation timeout, the command will fail with a timeout error.
- If the URL is a relative path (e.g.,
/products), it will be resolved relative to the current page URL.
- Use full URLs (starting with
http://orhttps://) for reliability. - Use
${variable}substitution to make your URLs dynamic. - If a page takes a long time to load, increase the
navigation_timeoutin project settings.
go_back
Section titled “go_back”Navigates to the previous page in browser history.
Description
Section titled “Description”The go_back command tells the browser to go back to the previous page in its history, similar to clicking the browser’s back button.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
wait_until |
String | No | "commit" |
When to consider the navigation complete. Options: load, domcontentloaded, networkidle, commit. |
Example
Section titled “Example”{ "command": "go_back", "params": { "wait_until": "networkidle" }}Behavior Notes
Section titled “Behavior Notes”- The default
wait_untilis"commit", which means the command completes as soon as the navigation starts. - The command has a hard timeout of 10 seconds.
- If there is no previous page in history, the command will fail.
Wait Until Options
Section titled “Wait Until Options”| Option | Description |
|---|---|
load |
Wait for the load event (all resources loaded). |
domcontentloaded |
Wait for the DOMContentLoaded event (HTML parsed). |
networkidle |
Wait until there are no network connections for 500ms. |
commit |
Wait for the navigation to be committed (fastest). |
- Use
networkidleif you need to wait for all resources to load before proceeding. - Use
commitfor faster navigation when you don’t need to wait for resources.
go_forward
Section titled “go_forward”Navigates to the next page in browser history.
Description
Section titled “Description”The go_forward command tells the browser to go forward to the next page in its history, similar to clicking the browser’s forward button.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
wait_until |
String | No | "commit" |
When to consider the navigation complete. Options: load, domcontentloaded, networkidle, commit. |
Example
Section titled “Example”{ "command": "go_forward", "params": { "wait_until": "load" }}Behavior Notes
Section titled “Behavior Notes”- The default
wait_untilis"commit". - The command has a hard timeout of 10 seconds.
- If there is no next page in history, the command will fail.
- Use
go_forwardaftergo_backto return to the original page. - Use
networkidleif you need to wait for all resources to load.
reload
Section titled “reload”Reloads the current page.
Description
Section titled “Description”The reload command tells the browser to reload the current page, similar to pressing F5 or clicking the browser’s refresh button.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
wait_until |
String | No | "networkidle" |
When to consider the reload complete. Options: load, domcontentloaded, networkidle, commit. |
timeout |
Number (ms) | No | 30000 |
Maximum time to wait for the reload to complete. |
Example
Section titled “Example”{ "command": "reload", "params": { "wait_until": "networkidle", "timeout": 60000 }}Behavior Notes
Section titled “Behavior Notes”- The default
wait_untilis"networkidle", which waits until there are no network connections for 500ms. - The default timeout is 30 seconds.
- If the page takes longer than the timeout, the command will fail.
- Use
reloadto refresh data on a page that updates dynamically. - Use
networkidleto ensure all resources are loaded before proceeding. - Increase the timeout for slow-loading pages.
switch_to_tab
Section titled “switch_to_tab”Switches focus to a specific browser tab by its index.
Description
Section titled “Description”The switch_to_tab command tells the browser to switch focus to a specific tab. This is useful when your automation opens new tabs and you need to interact with them.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index |
Number | No | 0 |
The index of the tab to switch to (0-based). |
fallback_url |
String | No | "" |
If the tab doesn’t exist, open this URL in a new tab. |
Example
Section titled “Example”{ "command": "switch_to_tab", "params": { "index": 1, "fallback_url": "https://example.com" }}Behavior Notes
Section titled “Behavior Notes”- Tab indices are 0-based (the first tab is index 0).
- If the specified tab doesn’t exist and a
fallback_urlis provided, a new tab is opened with that URL. - If the specified tab doesn’t exist and no
fallback_urlis provided, the command will fail. - The command waits up to 5 seconds for a new tab to appear if the index is out of range.
- Use
switch_to_tabwhen your automation opens links in new tabs. - Use
fallback_urlto ensure a tab is always available, even if the expected tab doesn’t exist. - Tab indices are 0-based, so the first tab is index 0, the second is index 1, and so on.