Skip to main content
Home
  • Tutorials
    • Quality Assurance
    • Software Development
    • Machine Learning
    • Data Science
  • About Us
  • Contact
programsbuzz facebook programsbuzz twitter programsbuzz linkedin
  • Log in

Main navigation

  • Tutorials
    • Quality Assurance
    • Software Development
    • Machine Learning
    • Data Science
  • About Us
  • Contact

Cypress vs Selenium

Profile picture for user devraj
Written by devraj on 02/10/2021 - 09:32

Cypress and Selenium are test automation tools used for functional testing of web applications by automating browser actions. Selenium has been a widely-used tool for years, whereas Cypress is a recently introduced tool in the test community.

In spite of Cypress being recently introduced, it has gained significant traction, With such a significant growth in the adoption of Cypress, it’s natural for testers to compare the two before choosing the ideal tool for test automation.

So, the question is, how does Cypress compare to Selenium? Is Cypress a better alternative to Selenium? Like Selenium, Cypress is also an open-source test automation framework for testing web applications. And that’s where the big Cypress vs Selenium fight begins! 

Point of DifferenceSeleniumCypress
Language SupportedSupports all popular languages like JavaScript, Java, Python, Ruby, C#, Php, etc.Support JavaScript Only
Browsers SupportedChrome, IE, Safari, Edge, Firefox, OperaChrome, Edge, Firefox, Electron, Brave. In Version 10.8.0 Safari browser support is added using Playwright-Webkit.
Framework SupportedPyUnit, JUnit, TestNG, JBehave, Behave, Gauge, Specflow, NUnit, Robot, Mocha and more.Supports only Mocha JS
Setup ComplexitySetup is a bit challenging as it requires downloading browser-specific drivers and setting up the test environment. Selenium Grid Server and browser drivers have to be installed in the test machine. Even, setup is different for a cloud-based Selenium Grid where only browser drivers have to be installed on the test machine.Setup is simple. No dependencies or additional downloads required. Node JS, Mocha JS, and Cypress have to be installed on the test machine.
Integration with Other toolsWide range of integration options – CI/CD tools, reporting tools, and more.Limited integration support with CI/CD tools when compared to Selenium.
Driver DependenciesAppropriate browser driver has to be installed so that the test script can talk to the corresponding web browser.No driver dependency
Multiple TabsSupportedNot Supported - Workaround present
Multiple Browser Instances or DomainsSupportedNot Supported - Workaround present
iFrameSupportedNot Supported - workaround present
Execution SpeedSlowFast
Automatic WaitingNot SupportedNo requirement to add waits or sleep in the tests. Cypress automatically waits for commands and assertions before moving to the next instruction.
Default Screenshots and VideosNot Supported, write code for supportSupported by default
Network traffic ControlNot Supported - Workaround presentNo network lag as tests are executed within the browser. You can control, stub, and test edge cases without any involvement of the server.
Access to elements outside the DOMAccess only to the elements in the DOMA unique DOM manipulation technique helps Cypress in getting access DOM elements, timers, service workers, and more.
Documentation & Community SupportWell established documentation and firm community support from users across the globeVery intuitive documentation along with  rapidly growing community
Remote ExecutionSupported. Cloud-based Selenium Grid from LambdaTest can be used to expedite cross browser testing and automation testing.Not Supported
Mock Server, Spies, stubs, and clocksNot AvailableCypress has built-in facilities for mocking server responses, facilities that are crucial for their target audience: frontend developers. Cypress lets you control the behavior of functions, timers, and server responses with ease.
Mobile TestingMobile Testing with AppiumNot Supported
Test FlakinessTests can be flakyWith Cypress, tests are expected to be non-flaky. Because the tests on it are executed frontend only, with a mocking of all server responses, the test runs very fast. And the faster a browser test runs, the less flaky it is.
Time TravelNot SupportedSupported. Once the test ends, you can click on each command in the side panel, and you can see a screenshot of how the page looked like when the command was executing. This is called Time traveling.
Real Time reloadsNot supportedTests are reloaded when any change is made in the test implementation.
AsynchronousNoYes, cypress commands are asynchronous

Although Selenium and Cypress are both designed to automate browsers for testing purposes, they differ considerably in terms of architecture and performance. 

If your web application is built using modern JavaScript frameworks like React or Angular or any other JavaScript framework. and cross browser testing is not of high priority, Cypress might suit the best. When it comes to cross browser testing, Selenium is still the de-facto framework used by many users.

There is no clear winner in the Cypress vs Selenium debate. A better approach would be evaluating both the tools and seeing how Selenium and Cypress can be used to improve test coverage for your project.

Needless to say, prior to choosing an automation tool, one must weigh the pros and cons of every option. 

Related Content
Cypress Tutorial
Selenium Introduction
Cypress Testing Tool
Tags
Cypress
Selenium
  • Log in or register to post comments

Choose Your Technology

  1. Agile
  2. Apache Groovy
  3. Apache Hadoop
  4. Apache HBase
  5. Apache Spark
  6. Appium
  7. AutoIt
  8. AWS
  9. Behat
  10. Cucumber Java
  11. Cypress
  12. DBMS
  13. Drupal
  14. GitHub
  15. GitLab
  16. GoLang
  17. Gradle
  18. HTML
  19. ISTQB Foundation
  20. Java
  21. JavaScript
  22. JMeter
  23. JUnit
  24. Karate
  25. Kotlin
  26. LoadRunner
  27. matplotlib
  28. MongoDB
  29. MS SQL Server
  30. MySQL
  31. Nightwatch JS
  32. PactumJS
  33. PHP
  34. Playwright
  35. Playwright Java
  36. Playwright Python
  37. Postman
  38. Project Management
  39. Protractor
  40. PyDev
  41. Python
  42. Python NumPy
  43. Python Pandas
  44. Python Seaborn
  45. R Language
  46. REST Assured
  47. Ruby
  48. Selenide
© Copyright By iVagus Services Pvt. Ltd. 2023. All Rights Reserved.

Footer

  • Cookie Policy
  • Privacy Policy
  • Terms of Use