Sometimes your workflow may involve multiple tabs or windows (these function the same way in GoScript, so we will refer to them as tabs for the rest of this article), or frames. For example your authentication workflow may involve a third party sign in box opening in a new tab.
There are several instructions available in GoScript to handle these situations.
focus tab waits for the given string to appear on any tab, then switches to the tab it appeared on.
def create_doc click: New blank document # The will focus on a newly opened tab containing the matching text focus tab: Simplified Ribbon< click: Foo click: Bar
focus frame takes a complete or partial URL for a frame/iframe on the current page, then makes that frame the active frame for future commands.
click: Open Video # We can just specify the frame's URL or part of focus frame: /video/player click: Play click: Pause # Now return focus to the wider application focus frame: all