switch
Switch the active browser tab by title, URL fragment, or index
Select a browser tab after a click that opens a new tab (target="_blank" / window.open). Not for iframes — use scope.
Syntax
And I switch to tab "<identifier>"Qualifiers
| Qualifier | Role | Example |
|---|---|---|
to tab | Tab identifier | switch to tab "Help" |
Identifier kinds
| Type | Example | Matches when |
|---|---|---|
| Title fragment | "Help" | Tab title contains Help |
| URL fragment | "/help" | Tab URL contains /help |
| Index | "0", "1" | 0-based position ("0" = first tab) |
Examples
When I click on "Open help tab"
And I switch to tab "Help"
Then I should see "Documentation"
And I switch to tab "0"Notes
- After
switch to tab, all steps run on that tab until the next switch.