TestCafe Studio can run tests in desktop, headless, and mobile browsers. It determines which browsers are installed on the local computer and automatically creates run configurations for them. You can view available configurations and switch between them in the Run Configuration drop-down menu.
To modify configurations or create a new one, click next to the Run Configuration drop-down menu and use the Run Configurations dialog. You can select one or more browsers and specify options that affect test execution for each configuration.
Before running tests, select a desired run configuration from the Run Configuration list.
You can run a test directory/subdirectory, a file with tests, a specific fixture, or an individual test.
To run an entire test directory or subdirectory, click Run all tests next to the directory in the Explorer panel.
To run a recorded test file or a specific fixture from the Explorer panel, click Run all tests next to the corresponding node. You can also run a specific fixture from the Fixture Editor by clicking on the toolbar.
To run an individual test, choose one of the following:
To run a test script file, click Run test next to the file in the Explorer panel. You can also click to run test fixtures and individual tests from the Code Editor.
To run several tests from different fixtures and directories, select the tests in the Explorer panel using Shift-click, Ctrl-click, or Command-click, then select Run tests from the context menu or click Run Tests next to any selected item.
After starting a test, TestCafe Studio launches the specified browsers and executes tests in them simultaneously. The Reports panel displays the tests' progress.
Click in the Reports panel to stop the test run.
TestCafe Studio allows you to run tests in browsers without a user interface - in headless mode. It automatically creates separate run configurations for local browsers that can be run headless.
You can also create your own run configuration and select desired headless browsers in run configuration settings.
You can run tests in headless browsers in the same way as you do for browsers with a user interface: select a desired run configuration, then start tests. TestCafe Studio runs tests in the background, however you can view test progress in the Reports panel.
TestCafe Studio allows you to run tests on any device that has network access to the machine where TestCafe Studio is installed.
Follow the steps below to run a test in remote browsers:
Create a run configuration for remote testing. In run configuration settings, select the Remote browser checkbox and specify the number of browser instances you are going to use for testing.
Select this configuration in the Run Configuration list.
Click Run test to start the test. TestCafe Studio provides URLs to open in remote browsers.
Launch the desired browsers on a remote device and open the provided URLs in them, or use your device to scan QR-codes that represent the same URLs. The browsers connect to the TestCafe Studio server and start testing.
TestCafe Studio allows you to execute tests concurrently. You can use the Concurrency mode to invoke multiple browser instances. Each test runs in the first available instance.
To enable this mode and specify the number of browser instances, use the run configuration's Concurrency option available in Advanced Options).
TestCafe Studio cannot run concurrent tests in Microsoft Edge, because there is no known way to start Edge in a new window and make it open a URL.
You can also use the Concurrency option when testing a webpage in multiple browsers.
In this case, the same tests run in four Safari and four Firefox instances.
When you run tests in a remote browser, the number of browser instances should be divisible by the concurrency parameter's
n value. Otherwise, an exception is thrown.
If you test against multiple remote browsers, open and connect one browser's instances before you connect the next browser.
Before starting an on-page action, the test waits for the action's target element to appear in the webpage's DOM and become visible during the specified timeout. The status panel displays the Waiting for element to appear... status at this moment.
The test fails if the element cannot be found.
If a test contains the Switch to Iframe action, TestCafe Studio waits until the target iframe is loaded completely or the predefined timeout (5000 milliseconds) is reached before performing test actions in the iframe.
When a test executes an assertion, it recalculates the assertion until it matches the expected result or the assertion timeout is reached. Refer to Assertion Options for more information about assertion timeouts.
The status panel displays the blue Waiting for assertion execution... status at this moment.
If an assertion's target is an element property, the assertion waits for the element to become visible before checking its property. The same mechanism is used in waiting for an on-page action's target element.
The following assertion waits for the search results to become visible on the page and checks if the hotel count is 5 (the 5 HOTELS text should appear):
If the checked element does not appear within the timeout, the assertion fails (the Waiting for assertion execution... status color changes to red).
If the element appears within the timeout and the textContent property's value is 5 HOTELS, the assertion passes (the status color changes to green).
TestCafe Studio waits until a webpage is loaded in the following cases:
While the browser is waiting for the server's response, the status panel shows the Loading web page... status.
The maximum wait time is 3000 milliseconds. When the timeout is over, the test starts or continues the execution even if the page is not completely loaded.
If the page requires extra time to load, you can add an assertion that verifies if page content is loaded.