• Money Tips | Product Reviews

Selenium Vs Cypress: Which is the better automation tool?

Selenium Vs Cypress - which is the better tool for me?

Both Selenium and Cypress are good for automated functional testing for web (browser) applications. They have their owns pros and cons just like any other tool. In other words, no tool is perfect but that doesn't mean it is all bad. LEt's review both these awesome tools and see their pros and cons by different features so you can get the full picture to decide which tool is best suited for your testing needs.

Cross Browser Testing Support

Selenium from its inception many many years back has continued to support major browsers such as Chrom(ium), Firefox, Internet Explorer, Opera, and Safari. TO run your test you need to download and configure webdriver for each of these browsers (ChromeDriver for Chrome browser, Firefox driver for Firefox, etc..).

Cypress on the other hand supports few browsers as of its writing namely Chromium-based browsers (Chrome and Edge) and Firefox. The best part I like is that you don't need a driver to download and configure, unlike the Selenium web driver. This is because Cypress does not depend on a WebDriver.

IFrame support

WIth Cypress support for IFrame is very limited. You can use custom code to overcome this but it does take an effort on your own to get the support. No support for multiple tabs.

Selenium supports iframe and multiple tabs.

With Selenium webdriver, you can easily switch to a particular iFrame as shown here with an example.

Language support

Cypress is a javascript-based automation tool that is built on a javascript framework. It supports only JavaScript language scripting for writing automated tests.

Selenium supports several languages including Java, Python, C#, Ruby, JavaScript, and Kotlin with its own language bindings libraries.

What tool should you pick - Selenium or Cypress?

First of all, neither one of them is perfect. That is what I think - maybe it is just me. It is purely subjective in the sense that it depends. One size does not fit all. One tool that works for one application might not be suitable for another application.

Coming soon! Here's a side-by-side comparison taking into account some general and finer requirements that your situation demands.