How to automate interacting with tabs

If you need to interact with tabs opening or closing during a run, you can use these no-code steps.

# How to switch to a tab


To switch to a tab in the running automation, use the "Switch browser tab" step. To add this step, use the Step Finder to search for "tab" and then add the "Switch browser tab" step. Once added, configure the step.

How
  1. Set the position of the tab to switch to - Leave on last opened tab, or specify the tab number. 1 chooses the tab on the farthest left, 2 the second from the left, and so on.

# How to close a tab


To close a tab in the running automation, use the "Close browser tab" step. To add this step, use the Step Finder to search for "tab" and then add the "Close browser tab" step. Once added configure the step.

How
  1. Enter the tab to close - Leave on last or set the number of the tab to close. 1 chooses the tab on the farthest left, 2 the second from the left, and so on.

# Automate tabs with Javascript

The "Write javascript" step can also be used to interact with tabs to learn how see here.

# Open a tab

 window.open('https://www.example.com');

# Close a tab

window.close();