Appearance
Tab Management
Many websites open new pages in separate tabs or windows—whether through links, buttons, or redirects. Sometimes you may need to work with multiple tabs at the same time.
UI-licious is designed to minimize how often you need to think about tabs, while still giving you explicit control when you need it.
Automatic tab switching when a new tab opens
One key behavior in UI-licious is automatic tab switching.
Whenever a new page is detected in a new tab—whether triggered by:
I.goTo()withnewTab: true- clicking a link that opens a new tab
- a user action that results in
window.open
UI-licious will automatically switch focus to the newly opened tab.
This means that in most cases, you do not need to explicitly switch tabs after a new page opens.
js
I.goTo("https://example.com")
I.click("Docs")
// A new tab opens — UI-licious automatically switches to it
I.see("Documentation")Automatic tab switching on tab close
UI-licious also automatically detects when a page is closed by the application itself.
This commonly happens when a popup (such as a child window opened using window.open) closes itself programmatically — typically after a form submission.
When this occurs, UI-licious automatically switches focus to the next available tab. There is no need to explicitly switch tabs in these scenarios.
This ensures that the test can continue execution reliably even when tabs are opened and closed dynamically by the application.
Switching tabs explicitly
When you have multiple tabs opened, you can explicitly switch tabs using the I.switchTab command.
js
I.switchTab()By default, this switches to the next tab.
You can also switch tabs by index, or by page title:
js
I.switchTab(2)
I.switchTab("Wikipedia")Refer to the I.switchTab reference to learn more.
Closing tabs
To close the currently active tab, use I.closeTab().
js
I.closeTab()When a tab is closed, UI-licious automatically switches focus to the tab immediately to the right. You do not need to manually switch tabs after closing one.
If there is only one tab open, the command is ignored.
Refer to the I.closeTab reference to learn more.
TIP
Closing tabs when they are no longer needed can improve test performance, especially in long-running tests or when working with many tabs.