Native Automation Mode

TestCafe uses a reverse proxy to execute tests across different browsers, but this technique complicates the framework.

Since the original release of TestCafe, a number of native browser automation protocols became widely used. These protocols offer superior automation speeds and greater stability. That’s why the TestCafe team decided to gradually phase the reverse proxy out in favor of native support for these automation protocols.

If you use TestCafe v2.5.0 and up, you can automate Chromium-based browsers, such as Google Chrome and Microsoft Edge, with the native CDP protocol.

You can enable native automation mode from the command line interface, the Test Runner API, and the configuration file.

Migrating to Native Automation mode

The TestCafe proxy uses custom client-side automation scripts to emulate browser events. Native Automation mode, as the name suggests, uses the CDP protocol to natively fire browser events.

If you designed your tests for an earlier version of TestCafe, you may have inadvertently adjusted their code to accommodate the framework’s flawed event emulation. As a result, if you enable Native Automation, you may notice slight differences in your tests’ behavior. Tests that interact with custom elements, or perform calculations related to element state, may even fail.

If a test runs well without Native Automation, but fails when you enable the new mode, this behavior may not be a mistake. Check your code and make edits when appropriate.


The TestCafe automation proxy was independent of browsers’ internal logic. This independence allowed TestCafe to grow its capabilities beyond what browsers can do “out of the box”.

Native automation limits the range of available browser interactions. As a result, the TestCafe team needs to come up with elaborate workarounds to keep all framework capabilities intact.

Below is the list of capabilities that do not currently work in Native Automation mode. Please be patient as the team works to resolve these issues.


Include the --native-automation CLI flag when you launch TestCafe.

testcafe chrome tests --native-automation

Test Runner API

Set the nativeAutomation option to true when you launch the TestCafe Test Runner.

const createTestCafe = require('testcafe');

const runner = createTestCafe();{
    nativeAutomation: true;

Configuration File

Set the nativeAutomation option to true in the configuration file.

   "nativeAutomation": "true"