t.switchToMainWindow Method

Switches the test’s browsing context from an <iframe> back to the main window. Can be chained with other TestController methods.

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

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

fixture`TestController.switchToMainWindow`
    .page`https://www.devexpress.com/`;

test('Switching back to main window', async t => {
    await t
        .click('#TOCChatLink')
        .switchToIframe('#chat-widget')
        .typeText('#name', 'My name')
        .switchToMainWindow()
        .click('[data-event="DownloadTrialHomeLightbox"]');
});

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