The requested page is not available for the requested platform. You are viewing the content for Default platform.

FAQ

General Questions

I have heard that TestCafe Studio does not use Selenium. How does it operate?

Unlike most testing solutions, TestCafe Studio is not built on Selenium. This allows us to implement features you cannot find in Selenium-based tools (for example, testing on remote devices without installing plugins, auto-wait mechanisms, etc.).

TestCafe Studio uses a URL-rewriting proxy which allows it to work without the WebDriver. This proxy injects the driver script that emulates user actions into the tested page.

What is the difference between TestCafe Studio and open-source TestCafe?
  TestCafe TestCafe Studio
No need for WebDriver, browser plugins or other tools
Cross-platform and cross-browser out of the box
Write tests in the latest JavaScript or TypeScript
Clear and flexible API supports ES6 and PageModel pattern
Stable tests due to the Smart Assertion Query Mechanism
Tests run fast due to intelligent Automatic Waiting Mechanism and Concurrent Test Execution
Custom reporter plugins
Use third-party Node.js modules in test scripts
Integration with popular CI systems  ✓*
Visual Test Recorder  
Interactive Test Editor  
Automatic Selector Generation  
Run Configuration Manager  
IDE-like GUI  

* You can use the open-source TestCafe test runner to integrate tests with CI systems.

What is the difference between TestCafe Studio and TestCafe v2015.1?

You can find this information in our blog.

Which browsers does TestCafe Studio support? What are the exact supported versions?

You can find a list of supported browsers in our documentation. TestCafe Studio is tested against the two latest versions of each browser (except browsers whose versions are specified explicitly in this list).

However, TestCafe Studio should work properly with browsers that support HTML5 and released in the last three years.

What is the current version of TestCafe Studio? How to update it?

To view the current version number:

  • MacOS: Open the TestCafe Studio menu and select the About command.
  • Windows and Linux: Open the Help and select the About command.

This invokes the dialog that displays version information.

The About dialog

To download the latest version, visit our site.

For Windows and MacOS: When a newer version of TestCafe Studio is available, the notification appears on the main toolbar. Click the Install link to update to this version.

Update version

I found a bug. How do I report it?

You can report a bug in our Support Center.

Testing

What is the difference between two test types: recorded tests and test scripts?
  Recorded Test Test Script
Consists of ... Test actions JavaScript or TypeScript code
How to create? Use the visual recorder Write code in the Code Editor
How to edit? * Use the recorder to add new actions to an existing test
* Add, update, and remove test actions in the Test Editor
Use the Code Editor
How to convert to another test type? Can be converted to JavaScript Cannot be converted to recorded tests
File extension .testcafe .js, .ts
Can I use the Visual Recorder for test scripts?

You cannot record a test script directly. However, you can record a test with visual steps - a recorded test, then convert it to JavaScript.

For more information about the difference between recorded tests and test scripts, see the previous question.

How to make sure that my test is being recorded correctly?

When you interact with a webpage during recording, TestCafe Studio automatically adds corresponding actions to a test. You can view them in the Test Editor and check if they are what you need. For example:

  • TestCafe Studio generates a set of element selectors for a target element in a test action and adds one of them to the action parameters. Make sure that this element selector fits your needs, or select another one right during recording.

    The set of element selectors

    You can also view the element that corresponds to this selector on the webpage. See Elements Highlighting.

  • While recording, you can perform some extra actions that are unnecessary for your test, for example, clicks or key presses. TestCafe Studio records them too. These actions can increase the test duration and affect the test result. You can delete them from the test during recording.

Finally, after the test was recorded, run it to ensure it passes.

Can I use third-party modules in tests?

Currently, you can use third-party modules only in test scripts. You can import these modules into the test script like regular node.js modules.

On the server side, use the import statement.

import fs from 'fs';

fixture `fixture`
  .page('http://localhost/testcafe/');

test('test', async t => {
   var filePath = 'filepath.js';

   await t.expect(fs.existsSync(filePath)).ok();
   });

On the client side, use t.eval to include a module in the test. You can use this module inside client functions and selectors.

test('test', async t => {
   // eval jquery code to add jQuery to the page
   await t.eval(new Function(fs.readFileSync('./jquery.js').toString()));

   var clientFunction = ClientFunction(() => {
       // You can use $ here
       return $('div').text();
   });

   var text = await clientFunction();
});
How to clear browser cookies and local storages between test runs?

There is no need to do this. TestCafe Studio clears browsing data before starting a test: cookies, local storages, and user profiles.

How to create user roles?

User roles are not supported in recorded tests. However, you can convert your test to a test script and use user roles as described here.

How to intercept HTTP requests?

Intercepting HTTP requests are not supported in recorded tests. However, you can convert your test to a test script and handle HTTP requests as described here.

Assertions

How to check if an element exists

Use the the Ok assertion to verify the element's exists property.

For example, the following assertion checks if the Submit button exists:

Ok

How to check if an element is visible or focused

Use the Ok assertion to verify the element's visible or focused property (see Element Properties).

Ok

How to check the number of elements

To check the number of elements, use the Deep Equal assertion to verify the count property (see Element Properties).

For example, the following assertion checks the number of label elements on the page:

Deep Equal

You can also check the number of elements in more complex scenarios, for example, when you perform search queries or test table filtering. In these cases, you can use different assertions: Greater than, Less than, Within, and so on.

The following assertion verifies if the number of table rows is between 3 and 5:

Within

How to check an element's text

Use the Contains or Match assertions to check an element's text.

For example, to check the text in an input or textarea, verify the element's value property:

Contains

For other elements, you can verify the innerText or textContent property. For example, the following assertion verifies the article header's text:

Contains

Note

We do not recommend that you use the Deep Equal assertion to check an element's text because the text can contain zero-width characters like newline symbols, white spaces, and so on.

How to check an element's attribute value

You can use the Deep Equal, Ok or other assertions to check an element's attribute value.

To access the element's attributes, add an assertion during test recording. The attributes are displayed in the Attributes category of the property grid.

Access attributes

For example, the following assertion checks the button's type attribute:

Deep Equal