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)/)
NameTypeDescription
identifierunknown
targetUrlstringURL/Page title of the tab to close. Default: undefined.
TypeDescription
Promise<void>