Handle multi-tab flows

This topic describes using a Switch step to switch the script's run context from one browser tab to another.

Overview

When you run a script, it runs on the applications you defined in the Script applications pane or on an application you select at the beginning of the run. By default, all steps run on the original browser tab that opened the application.

In some cases, your script flow opens additional tabs, and subsequent steps need to run on those newly opened tabs. Later in the script, you may need to switch back to previously opened tabs, or to the original tab where the run started.

To switch the context of your run to another tab, you can add a Switch to another tab step to your script in the Editor and the step editing pane.

Back to top

Using the Switch tab step

When using Switch to another tab steps, keep the following in mind:

  • You can switch only to a browser tab that is already open.
  • You must provide a unique description of the tab.
  • If the tab you describe is open in another browser, the script switches to the other browser.
  • If you didn't select to leave the application open at the end of the run, all tabs that the script switched to during the run are closed at the end of the run.
  • During a Switch to another tab step, while searching for the tab to switch to for the next steps, other tabs are displayed for a moment.
  • If you select to switch to the newest tab, and the current tab has the latest creation time, the script continues to run in the same tab.

Back to top

Create a Switch tab step

Create the step in the Editor and complete its details in the step editing pane.

  1. In the script Editor, click the Add step button and select Switch to another tab.
  2. In the step editing pane specify which tab to switch to. You can select from the following options:

    • The newest tab. This is the tab with the latest creation time.
    • The original tab. This is the tab where the script run started.
    • Another tab, described by the URL open in that tab.
    • Another tab, described by the title of the page open in that tab.
  3. Enter additional details:

    • If you selected to switch to the newest tab, an Opened by previous step option is selected by default. This provides time to wait for the recently opened tab to load.

      You can adjust the length of the timeout, or you can deselect the option and skip the timeout if you know the tab is already open.

    • If you selected to describe the tab by URL or title:

      Uniquely describe the tab by providing the full URL or title, or a substring it must contain.

      Enter a text string or use a parameter. For details on using parameters, see Pass a value to the script.

You can also type the whole step manually, following the required syntax. For details, see Step syntax. However, the Opened by previous step option is available only in step editing pane.

Back to top

See also: