t.getCurrentWindow Method

Returns a unique window descriptor that corresponds to the active window. Chainable.

t.getCurrentWindow() → this | Promise<unknown>

Example

fixture`TestController.getCurrentWindow`
    .page('https://devexpress.github.io/testcafe/example/');

test('Should close curren window', async t => {
    await t.openWindow('https://devexpress.com');

    const devexpress = await t.getCurrentWindow();

    await t.closeWindow(devexpress);
});