Download Files in IE


TestCafe 3.0 and up does not support Internet Explorer.

To download files in Internet Explorer, you need to manually process unskippable native dialogs.

IE popup

Consider the following markup:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <form method="get" action="../src/file.txt">
        <button id="downloadButton" type="submit">Download!</button>

This page includes a button that triggers a file download. To skip the native dialog in IE, and successfully download the file, use a RequestLogger:

import { RequestLogger } from 'testcafe';

const fileDownloadLogger = RequestLogger(new RegExp('src/file.txt'), {
    logResponseBody:       true,
    stringifyResponseBody: true,

fixture`Interact With the Page`

test('Download a file in IE and verify contents', async t => {
    await t
        .expect(fileDownloadLogger.contains(r => {
            return /File contents here/.test(r.response.body) && //verify response body
                   r.response.statusCode === 200; //verify response status code

We know the location of the target file, so we can monitor requests to that file with a RequestLogger, and verify the response with a regular expression.


Server responses are binary. Use the RequestLogger‘s stringifyResponseBody option to decode them.