In which ways is TestCafe better than Selenium? [closed]
Asked Answered
G

1

11

What problems does TestCafe overcome that justify its adoption over Selenium? Is it worth to port over older test suits to TestCafe?

Graphomotor answered 13/11, 2017 at 15:47 Comment(0)
S
31

There are numerous reasons why we at the TestCafe team decided against building TestCafe on top of Selenium.

First, we wanted to simplify setting up the test environment. To start with Selenium, you need to install the WebDriver client for the desired programming language and the appropriate drivers for each browser you're going to test in.

While it sounds rather easy, practically it's quite a hassle to just get started with testing. This hassle becomes even greater if you need to configure your test environment at scale, e.g. for your local CI server.

There are numerous node.js testing solutions based on top of Selenium in npm. You can see that they require some significant amount of setup and configuration work just to get started. This is far from the simplicity of the npm install setup we got used to in other tools from modern web developer’s tool belt.

TestCafe also has some features that wouldn’t be possible if TestCafe used Selenium as an underlying platform. For instance, TestCafe can run tests on remote devices including mobile. This means that you can run tests on a machine that doesn't have TestCafe installed. You only need to open a link in its browser and the testing starts (if the host and target devices see each other in the network). This feature can be used to quickly demonstrate a bug to an engineer that doesn’t have TestCafe or node.js installed at all.

Other features that would be hard to implement on top of Selenium include:

Isolated test environment. Each TestCafe test runs as if it was started in a new incognito tab. You will have all cookies and storages clean. This helps avoid a lot of boilerplate test code and allows you to work in the same browser without the risk of state interference. This also enables us to implement such mechanisms as the upcoming Roles feature with which you’ll be able to interact with the page from different users’ perspective or easily perform form authentication across tests.

Implicit auto-waits mechanism. TestCafe automatically waits for XHR requests, page loads and page animations, so you don’t need to take care of it in your code.

Sheeree answered 13/11, 2017 at 16:11 Comment(4)
The last paragraph "Implicit auto-waits mechanism. TestCafe automatically waits for XHR requests, page loads and page animations, so you don’t need to take care of it in your code" should be the first one. You would have me sold right from the start :-)Graphomotor
Generally all new Selenium browser sessions are isolated, using a new browser profile that comes with empty cookies and storage.Rubie
Selenium also provides implicit waits for the appearance of elements that are being selected.Rubie
@Rubie it doesn't help when I wait for rendering on canvasIsoagglutination

© 2022 - 2024 — McMap. All rights reserved.