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

Test Editor

  • 3 min to read

The Test Editor allows you to create new recorded tests, and view and modify tests. To open the editor, double-click the test's item in the Explorer panel or click the test's row in the Fixture Editor. If you create an empty test or start recording a new test, TestCafe Studio automatically opens the test in the editor.

The Test Editor consists of the following parts:

  • The toolbar - Provides information about the test (the test name, fixture name, tested page's URL) and buttons for performing common tasks.

    You can click the fixture name to open the fixture in the Fixture Editor. You can also click the webpage's URL to view the webpage in the browser.

  • The test area - Displays the current test's content.

  • The Actions panel - Lists actions you can add to the test. The actions are organized into categories. You can click the arrows next to category names to expand or collapse the categories.

Test editor

Common Tasks

You can perform the following tasks in the editor:

Add Actions from the Actions panel

Click an action in the Actions panel to add it to the test. TestCafe Studio adds the action to the end of the test and allows you to specify the action's parameters.

Add new actions

You can add actions after or during recording. If it's the latter, you can pick an element on a webpage to set it as an action parameter (for example, Element Selector for on-page actions or assertions).

Record Actions

You can record on-page actions and append them to the current test.

Click the Record button Record test actions button on the toolbar to start recording and wait while TestCafe Studio plays back the existing actions. Next, perform new actions on the tested page. TestCafe Studio records your activity and inserts new actions after the previous actions.

To stop recording, close the browser or click the Stop recording button button on the editor's toolbar.

Run Tests

Click the Run tests button Run test button on the editor's toolbar to run the test.

Modify Actions' Parameters

Click the action's row to expand the action parameters area that allows you to view or modify action parameters.

Change an Action's Position

Hover the mouse cursor over the Drag icon button to the left of the action's name until the cursor icon changes to the Drag icon icon, then drag the action to a new position.

Rename Tests

Click the Rename button button on the editor's toolbar to rename the test. The Rename test dialog appears and allows you to specify a new test name.

Rename test dialog

Delete Actions

Click the Remove all actions icon Remove all actions button on the editor's toolbar to delete all the actions from the test.

To delete a single action, hover the mouse cursor over the action's row and click the row's Remove icon Remove action button.

Convert the Test to JavaScript

Click Convert icon Convert to JavaScript Code on the editor's toolbar to convert the test to a .js file. This invokes the Convert to JavaScript dialog that allows you to specify the file's name.

Convert to JavaScript Code Dialog

TestCafe Studio creates the test file in the same test directory and displays it in the Explorer panel.