Test.disablePageCaching Method

Note

Disable native automation to set the disablePageCaching option.

Disables page caching for a particular test.

You may inadvertently navigate to a cached page that contains outdated automation scripts: for example, when you activate a Role. This can lead to TestCafe errors. Use the Test.disablePageCaching method to disable page caching.

See Troubleshooting: Test Actions Fail After Authentication for more information.

test.disablePageCaching → this

Example

test('My test', async () => {
    /* ... */
}).disablePageCaching;

You can also disable page caching during all tests in a fixture with the fixture.disablePageCaching method.