Taiko
Documentation

Home / API Reference

openTab

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

Examples

await openTab('https://taiko.dev')
await openTab() # opens a blank tab.

Parameters


targetUrl string

Url of page to open in newly created tab.

Default value
undefined

options

options.waitForNavigation boolean

Wait for navigation after the reload. Default navigation timeout is 5000 milliseconds, to override pass { navigationTimeout: 10000 } in options parameter.

Default value
true

options.navigationTimeout number

Navigation timeout value in milliseconds for navigation after click. Accepts value in milliseconds.

Default value
5000

options.waitForStart number

time to wait to check for occurrence of page load events. Accepts value in milliseconds.

Default value
100

options.waitForEvents

Page load events to implicitly wait for. Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']]

Default value
['firstMeaningfulPaint']

Returns

Promise