DEV Community

loading...
Cover image for Selenium vs WebDriverIO vs Cypress

Selenium vs WebDriverIO vs Cypress

Muntasir Abdullah Mizan
BUg huNteR
・2 min read
                        Selenium
Enter fullscreen mode Exit fullscreen mode

Pros of using Selenium:

  1. Open-source software so it’s Free.

  2. Integrated with Agile, DevOps, Continuous Delivery workflow.

  3. Supports mobile testing.

  4. Wide range of supported languages, platforms, and browsers.

  5. Huge community.

  6. Large library of plugins and extensions.

  7. Reduce overall test execution time.

  8. Automating Web UI components.

  9. Ease of Implementation.

  10. Well integrated with other DevOps tools such as Jenkin and Gitlab to automate the CICD pipeline.

  11. Record and play features.

Cons of using Selenium:

  1. Steep learning curve.

  2. Only used for web-based apps.

  3. No built-in image comparison.

  4. No tech supports.

  5. No reporting capabilities.

  6. Advanced programming skills are required.

                      WebdriverIO
    

Pros of WebdriverIO:

  1. Works with any testing framework or assertion library

  2. Excellent API documentation

  3. Config file generation wizard

  4. Provides plugins for a gulp

  5. Simpler syntax than selenium-webdriverjs and WD.js

  6. Selenium Server need not be started independently

Cons of WebdriverIO:

  1. Must run with WDIO to debug

  2. Selenium server must be started independently

  3. Have no docs for the latest version (4.0.5)

                        Cypress
    

Pros of Cypress:

  1. Cypress does not use Selenium: most of the end-to-end tools that we have experimented with, are using Selenium, that’s why they have almost the same problems.

  2. Cypress supports any framework or website quite well: There are hundreds of projects using the latest React, Angular, Vue, Elm, etc. frameworks. Cypress also works equally well on older server-rendered pages or applications.

  3. Cypress tests are only written in JavaScript: While you can compile down to JavaScript from any other language, ultimately the test code is executed inside the browser itself. There are no languages or driver bindings - there is and will only ever be just JavaScript.

  4. There are no dependencies, you put your test in package.json and that’s it.

  5. Cypress runs much, much faster in comparison with the end-to-end tools by Selenium that we have experimented with.

  6. There is a screenshot for every step, of your script, which can be quite helpful if there is any false passing or failing test, yeah good for debugging!!

  7. Cypress has a clear syntax, it is easy to read it, you will like it!!

Cons of Cypress:

  1. The structure was different from the other Selenium end-to-end tools, so at first, you may need to spend more time understanding the structure and finding the best way to create your scripts.

  2. Community: As Cypress is relatively new, the community is small. You will have trouble finding answers to problems etc.

  3. Features. No file upload support. No cross-browser testing. Who knows when these things will be covered, as for big projects these features are crucial.

  4. Page Object Model. It is something that has already been proven over time. Cypress supports a different approach which could be controversial.

  5. It's only available for only one client (language) i.e., for JavaScript-only. So, to work with it you must know JavaScript: however, this might be an advantage for JavaScript application, but I would like to put it as a disadvantage for those who have difficulties with JavaScript.

Discussion (1)

Collapse
liviufromendtest profile image
Liviu Lupei

Cypress also has the following major disadvantages:

  1. Cannot deal with multiple browser tabs.
  2. Does not run in Safari (2nd most used desktop browser).
  3. Cannot simulate native events such as Hover.
  4. Does not work with a lot of websites (see issue here)

Responsible developers cannot rely on Cypress, since they tend to test in Safari.
And they also need to access multiple browser tabs (scenarios such as 2FA).

That's why you won't see anyone using Cypress at companies such as Microsoft, Airbnb, Amazon, etc.