t.switchToMainWindow Method

Switches the test execution context from an <iframe> back to the main window. Chainable.

t.switchToMainWindow() → this | Promise<any>

The example below demonstrates how to use t.switchToMainWindow action.


test('Switching back to main window', async t => {
    await t
        .typeText('#name', 'My name')

You can switch from the main window to a specified <iframe> with the t.switchToIframe method.