Skip to content

openTab()

Launches a new tab. If url is provided, the new tab is opened with the url loaded.

await openTab('https://taiko.dev')
await openTab() # opens a blank tab.
await openTab('https://taiko.dev', {name: 'taiko'}) # Tab with identifier
NameTypeDescription
targetUrlstringUrl of page to open in newly created tab. Default: undefined.
optionsObjectDefault: {}.
options.waitForNavigationbooleanWait for navigation after the reload. Default navigation timeout is 5000 milliseconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true.
options.namestringTab identifier
options.navigationTimeoutnumberNavigation timeout value in milliseconds for navigation after click. Accepts value in milliseconds. Default: 5000.
options.waitForStartnumbertime to wait to check for occurrence of page load events. Accepts value in milliseconds. Default: 100.
options.waitForEventsArrayPage load events to implicitly wait for. Events available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: [].
TypeDescription
Promise<void>