Skip to content

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.

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.

Parameter Type Required Default Description
url String Yes — The URL to navigate to. Supports ${variable} substitution.
{
"command": "goto",
"params": {
"url": "https://example.com/products"
}
}

With variable substitution:

{
"command": "goto",
"params": {
"url": "https://example.com/search?q=${search_term}"
}
}
  • The navigation timeout is controlled by the project’s navigation_timeout setting (default: 30000ms / 30 seconds).
  • The command waits for the domcontentloaded event before proceeding.
  • If CAPTCHA solving is enabled, RTILA will attempt to solve any CAPTCHA that appears after navigation.
  • If respect_robots_txt is enabled, RTILA will check the site’s robots.txt before navigating and skip the navigation if the URL is disallowed.
  • 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:// or https://) for reliability.
  • Use ${variable} substitution to make your URLs dynamic.
  • If a page takes a long time to load, increase the navigation_timeout in project settings.

Navigates to the previous page in browser history.

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.

Parameter Type Required Default Description
wait_until String No "commit" When to consider the navigation complete. Options: load, domcontentloaded, networkidle, commit.
{
"command": "go_back",
"params": {
"wait_until": "networkidle"
}
}
  • The default wait_until is "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.
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 networkidle if you need to wait for all resources to load before proceeding.
  • Use commit for faster navigation when you don’t need to wait for resources.

Navigates to the next page in browser history.

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.

Parameter Type Required Default Description
wait_until String No "commit" When to consider the navigation complete. Options: load, domcontentloaded, networkidle, commit.
{
"command": "go_forward",
"params": {
"wait_until": "load"
}
}
  • The default wait_until is "commit".
  • The command has a hard timeout of 10 seconds.
  • If there is no next page in history, the command will fail.
  • Use go_forward after go_back to return to the original page.
  • Use networkidle if you need to wait for all resources to load.

Reloads the current page.

The reload command tells the browser to reload the current page, similar to pressing F5 or clicking the browser’s refresh button.

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.
{
"command": "reload",
"params": {
"wait_until": "networkidle",
"timeout": 60000
}
}
  • The default wait_until is "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 reload to refresh data on a page that updates dynamically.
  • Use networkidle to ensure all resources are loaded before proceeding.
  • Increase the timeout for slow-loading pages.

Switches focus to a specific browser tab by its index.

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.

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.
{
"command": "switch_to_tab",
"params": {
"index": 1,
"fallback_url": "https://example.com"
}
}
  • Tab indices are 0-based (the first tab is index 0).
  • If the specified tab doesn’t exist and a fallback_url is provided, a new tab is opened with that URL.
  • If the specified tab doesn’t exist and no fallback_url is 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_tab when your automation opens links in new tabs.
  • Use fallback_url to 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.