Skip to content

closeTab()

Closes the given tab with given URL or closes current tab.

# Closes the current tab.
await closeTab()
# Closes all the tabs with Title 'Open Source Test Automation Framework | Gauge'.
await closeTab('Open Source Test Automation Framework | Gauge')
# Closes all the tabs with URL 'https://gauge.org'.
await closeTab('https://gauge.org')
# Closes all the tabs with Regex Title 'Go*gle'
await closeTab(/Go*gle/)
# Closes all the tabs with Regex URL '/http(s?):\/\/(www?).google.(com|co.in|co.uk)/'
await closeTab(/http(s?):\/\/(www?).google.(com|co.in|co.uk)/)
Name Type Description
identifier unknown
targetUrl string URL/Page title of the tab to close. Default: undefined.
Type Description
Promise<void>