{"id":13660,"date":"2018-10-16T05:49:56","date_gmt":"2018-10-16T05:49:56","guid":{"rendered":"https:\/\/app14743.cloudwayssites.com\/blog\/?p=3660"},"modified":"2021-03-06T00:27:40","modified_gmt":"2021-03-06T00:27:40","slug":"cypress-vs-selenium-webdriver-better-or-just-different","status":"publish","type":"post","link":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/","title":{"rendered":"Cypress vs Selenium WebDriver: Better, or just different?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">There\u2019s a new claim to the throne of functional test automation tools: <\/span><a href=\"https:\/\/www.cypress.io\/\"><span style=\"font-weight: 400;\">Cypress.io<\/span><\/a><span style=\"font-weight: 400;\">. Is Cypress fast? Yes. Is Cypress interactive? Yep. Is Cypress reliable? You bet. And best of all\u2026 it\u2019s cool! <\/span><\/p>\n<p><span style=\"font-weight: 400;\">But is Cypress an alternative to <\/span><a href=\"https:\/\/www.seleniumhq.org\/projects\/webdriver\/\"><span style=\"font-weight: 400;\">Selenium WebDriver<\/span><\/a><span style=\"font-weight: 400;\">? Does Selenium, the current king of web automation and testing frameworks, cringe in fear for its position, or is it smiling benevolently at the supposed usurper, knowing full well that, well, it\u2019s just a kid!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Is Cypress better than Selenium WebDriver? I get asked this a lot. And frankly, the easiest path of a \u201cthis vs that\u201d article is to try and find out which is \u201cbest\u201d. But I will not take that path. Instead, I will try and explain how is Cypress <\/span><i><span style=\"font-weight: 400;\">different<\/span><\/i><span style=\"font-weight: 400;\"> from Selenium WebDriver.<\/span><\/p>\n<p><!--more--><\/p>\n<p><span style=\"font-weight: 400;\">By describing what is the difference between Cypress and Selenium WebDriver, you will be able to understand how Cypress works. This post will also try and explain <\/span><i><span style=\"font-weight: 400;\">why<\/span><\/i><span style=\"font-weight: 400;\"> Cypress took the path it did to web browser automation, a path that is remarkably different than the path WebDriver took.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">How is Cypress similar to Selenium WebDriver? They both control and automate the web browser, thus enabling you to write functional tests that simulate the actions that a user does, and verifying that the results are correct. But that is where the similarity ends, and the differences begin. Hopefully, knowing the differences between these two testing tools, and knowing the reasons for that difference, will help <\/span><i><span style=\"font-weight: 400;\">you<\/span><\/i><span style=\"font-weight: 400;\"> choose which tool to use, and when. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">So let\u2019s start exploring these differences. <\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s For Frontend Developers!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-3673\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/2000px-Front-end_Magazine_Logo.svg_-300x253.png\" alt=\"\" width=\"300\" height=\"253\">Selenium WebDriver was built for end-to-end regression tests of web applications. The Selenium front end testing framework is mostly used by QA developers, and not so much developers. This is because the idea of front-end developers testing their own code is not common.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But a small revolution is starting to happen in the world of frontend developers. Frontend developers are starting to write their own tests. Yes, they are rising to the challenge of <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Agile_software_development\"><span style=\"font-weight: 400;\">agile software methodologies<\/span><\/a><span style=\"font-weight: 400;\">. They understand that without writing their own tests, agile development cannot happen. They are writing unit tests, but also integration, and, yes, end-to-end functional tests that check their frontend using real browsers, just like the automation tests that QA developers write. The \u201c<\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Shift_left_testing\"><span style=\"font-weight: 400;\">Shift Left<\/span><\/a><span style=\"font-weight: 400;\">\u201d movement has a lot of these trends.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Frontend developers\u2019 needs for end to end tests are different than those of QA developers. Frontend developers don\u2019t need a staging environment where the <\/span><i><span style=\"font-weight: 400;\">whole <\/span><\/i><span style=\"font-weight: 400;\">application\u2014frontend, backend, and database systems\u2014is deployed. They can get by with just the frontend part running locally, and <\/span><a href=\"https:\/\/michael-kuehnel.de\/api\/2016\/11\/04\/data-mocking-ways-to-fake-a-backend-api.html\"><span style=\"font-weight: 400;\">mock the backend<\/span><\/a><span style=\"font-weight: 400;\"> pretty easily.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This fact &#8212; the target audience of Cypress is frontend developers &#8212; lies at the heart of all the differences between Cypress and WebDriver. They\u2019re different tools for different users.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s JavaScript Only!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-3671\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-300x300.png\" alt=\"\" width=\"300\" height=\"300\">Frontend web developers <\/span><a href=\"https:\/\/insights.stackoverflow.com\/survey\/2018\/\"><span style=\"font-weight: 400;\">write in only one language\u2014JavaScript<\/span><\/a><span style=\"font-weight: 400;\">. It is the only language that browsers can execute, and so they have no other choice. This limitation has its downsides and its upsides, but the fact exists\u2014there is only one language for frontend developers (variants like <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/TypeScript\"><span style=\"font-weight: 400;\">TypeScript<\/span><\/a><span style=\"font-weight: 400;\"> notwithstanding). <\/span><\/p>\n<p><span style=\"font-weight: 400;\">And, because Cypress is meant for frontend developers, Cypress tests can only be written in JavaScript. No other languages are supported. Compare that to Selenium WebDriver, which has an API with many <\/span><a href=\"https:\/\/www.seleniumhq.org\/download\/\"><span style=\"font-weight: 400;\">language bindings<\/span><\/a><span style=\"font-weight: 400;\">, including Java, C#, Python, Ruby, R, Dart, Objective-C, and, yes, JavaScript.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So remember\u2014if you want to do Cypress testing, you will have to learn JavaScript. Which is cool, because JavaScript today is not your grandparents\u2019 JavaScript. It\u2019s a modern, powerful, and concise language that is widely used today and has the largest open source package repository in the world (<\/span><a href=\"https:\/\/www.npmjs.com\/\"><span style=\"font-weight: 400;\">npm<\/span><\/a><span style=\"font-weight: 400;\">), a code repository that a few years back <\/span><a href=\"https:\/\/developers.slashdot.org\/story\/17\/01\/14\/0222245\/nodejss-npm-is-now-the-largest-package-registry-in-the-world\"><span style=\"font-weight: 400;\">overtook what used to be the largest repository<\/span><\/a><span style=\"font-weight: 400;\">, the <\/span><a href=\"https:\/\/maven.apache.org\/what-is-maven.html\"><span style=\"font-weight: 400;\">Java Maven<\/span><\/a><span style=\"font-weight: 400;\"> repository.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s Mocha Only!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-3670 size-full\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-1.png\" alt=\"\" width=\"192\" height=\"192\">Cypress doesn\u2019t only limit you in the language you can write, but also limits which testing framework you use. <\/span><a href=\"https:\/\/mochajs.org\/\"><span style=\"font-weight: 400;\">Mocha<\/span><\/a><span style=\"font-weight: 400;\"> is the testing framework that you write your tests with (a testing framework\u2019s role in JavaScript is similar to the role <\/span><a href=\"https:\/\/junit.org\/junit5\/\"><span style=\"font-weight: 400;\">Junit<\/span><\/a><span style=\"font-weight: 400;\"> has in Java, or <\/span><a href=\"https:\/\/nunit.org\/\"><span style=\"font-weight: 400;\">NUnit<\/span><\/a><span style=\"font-weight: 400;\"> in C#). You cannot write your tests in another JavaScript framework, such as <\/span><a href=\"https:\/\/jestjs.io\/\"><span style=\"font-weight: 400;\">Jest<\/span><\/a><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/github.com\/substack\/tape\"><span style=\"font-weight: 400;\">Tape<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Selenium WebDriver, on the other hand, does not impose a testing framework on you. Moreover, you don\u2019t even have to use a testing framework. You can write a regular program that is not a test, a program that just drives the browser. Many projects use WebDriver that way, for example to crawl web pages and gather information.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But Cypress decided early on that it is dedicated to the task of writing frontend tests, and can <\/span><i><span style=\"font-weight: 400;\">only<\/span><\/i><span style=\"font-weight: 400;\"> be used within a testing framework, and that testing framework MUST be Mocha.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Enough already. Show Me Some Cypress Code!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\u201cOK, OK, I got it,\u201d I hear you saying. But can you <\/span><i><span style=\"font-weight: 400;\">please<\/span><\/i><span style=\"font-weight: 400;\"> show me a Cypress test so that all this will be a bit less abstract? Sure, here you go:<\/span><\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/giltayar\/8017a772c13b84d246298d448a6a7d4f.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/giltayar\/8017a772c13b84d246298d448a6a7d4f\">Gist<\/a>.<\/noscript><\/div>\n<p><span style=\"font-weight: 400;\">As you can see, this has examples of Cypress commands and assertions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">cy.visit<\/span><span style=\"font-weight: 400;\"> will make the browser navigate to the url given.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">cy.get will return a reference to the element in question, on which you can either type, click, or check assertions on using contains and other assertions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As you can see, on the surface, it\u2019s surprisingly similar to Selenium Webdriver, albeit simpler, and with much more power.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s Chrome Only!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-3669\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/unnamed-300x300.png\" alt=\"\" width=\"300\" height=\"300\">The Cypress test runner only works on Chrome. It has no support for Firefox, Safari, Edge, or IE. This may come as a shock to QA developers that are used to WebDriver\u2019s <\/span><i><span style=\"font-weight: 400;\">amazing<\/span><\/i><span style=\"font-weight: 400;\"> support for all these browsers. But, yes, Cypress is Chrome only. There is an issue that was opened for <\/span><a href=\"https:\/\/github.com\/cypress-io\/cypress\/issues\/310\"><span style=\"font-weight: 400;\">cross-browser support<\/span><\/a><span style=\"font-weight: 400;\">, but that issue is almost a year old. Cypress\u2019 priorities, it seems, lie elsewhere.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Why would frontend developers want to run their tests only in Chrome? I believe there are multiple answers to that question. First, the differences between Chrome, Firefox, Safari, and Edge these days are small, and getting smaller and smaller for most applications. So checking only in Chrome is probably good enough when testing in development.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Second, running all the tests on all the browsers takes <\/span><i><span style=\"font-weight: 400;\">time<\/span><\/i><span style=\"font-weight: 400;\">, and frontend developers, as we said above, don\u2019t want to wait for their tests.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Third, many companies have QA developers that run end to end tests on all browsers, and so they are OK with the very rare bug slipping now and again and being caught by the QA team. And companies that don\u2019t have extensive cross-browser tests? Then they are OK with those same rare bugs slipping and reaching <\/span><i><span style=\"font-weight: 400;\">users<\/span><\/i><span style=\"font-weight: 400;\"> now and again.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Fourth, frontend developers <\/span><i><span style=\"font-weight: 400;\">do<\/span><\/i><span style=\"font-weight: 400;\"> care, and would like Cypress to support more browsers, but it\u2019s just not a <\/span><i><span style=\"font-weight: 400;\">priority<\/span><\/i><span style=\"font-weight: 400;\"> for them, given the reasons described above.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It Runs in The Browser!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Besides the fact that frontend developers are used to JavaScript, there\u2019s another reason, a more technical one, that only JavaScript is supported.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The code you write in your Cypress test scripts does not run outside of the browser, like in WebDriver. It runs <\/span><i><span style=\"font-weight: 400;\">inside<\/span><\/i><span style=\"font-weight: 400;\"> the browser. It is the <\/span><i><span style=\"font-weight: 400;\">browser<\/span><\/i><span style=\"font-weight: 400;\"> that is executing your test code. In fact, it\u2019s executing your test code <\/span><i><span style=\"font-weight: 400;\">alongside<\/span><\/i><span style=\"font-weight: 400;\"> the app code that you are testing!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">What happens when you run your test is that, first, Cypress will prepare your code to run in the browser (technically speaking, it will bundle all the modules in your code to one JS file using <\/span><a href=\"https:\/\/webpack.js.org\/\"><span style=\"font-weight: 400;\">webpack<\/span><\/a><span style=\"font-weight: 400;\">). Once ready, it will run Chrome, and inject your test code into a blank page. Then it will run that test code, in the browser.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">That test code first of all navigates to the application page (using `cy.navigate(\u2018<\/span><a href=\"http:\/\/localhost:8080\"><span style=\"font-weight: 400;\">http:\/\/localhost:8080<\/span><\/a><span style=\"font-weight: 400;\">\u2019)`), which is run in an <\/span><a href=\"https:\/\/www.w3schools.com\/html\/html_iframe.asp\"><span style=\"font-weight: 400;\">iframe<\/span><\/a><span style=\"font-weight: 400;\">. Cypress will make the iframe navigate to that page, but your code is running in the browser, and (somewhat magically) has access to the same <\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Document_Object_Model\/Introduction\"><span style=\"font-weight: 400;\">DOM<\/span><\/a><span style=\"font-weight: 400;\"> as that iframe, and so all commands, such as \u201cclick\u201d or \u201ctype\u201d, happen inside the browser, using regular <\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Document_Object_Model\"><span style=\"font-weight: 400;\">DOM APIs<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To compare, let\u2019s review Selenium WebDriver architecture and what this means for how Selenium tests run. Take a look at the diagram below.<\/span><\/p>\n<figure id=\"attachment_3700\" aria-describedby=\"caption-attachment-3700\" style=\"width: 929px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3700 size-full\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/Screenshot-2018-10-19-21.33.55.png\" alt=\"Selenium Webdriver architecture\" width=\"929\" height=\"354\"><figcaption id=\"caption-attachment-3700\" class=\"wp-caption-text\">Selenium Webdriver architecture<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400;\">With Selenium WebDriver, you have three processes:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Selenium WebDriver<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A browser driver, such as <\/span><a href=\"https:\/\/github.com\/SeleniumHQ\/selenium\/wiki\/ChromeDriver\"><span style=\"font-weight: 400;\">ChromeDriver<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/github.com\/mozilla\/geckodriver\/\"><span style=\"font-weight: 400;\">GeckoDriver<\/span><\/a><span style=\"font-weight: 400;\"> (for Firefox), <\/span><a href=\"https:\/\/developer.microsoft.com\/en-us\/microsoft-edge\/tools\/webdriver\/\"><span style=\"font-weight: 400;\">EdgeDriver<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/webkit.org\/blog\/6900\/webdriver-support-in-safari-10\/\"><span style=\"font-weight: 400;\">SafariDriver<\/span><\/a><span style=\"font-weight: 400;\">, etc.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The browser itself<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">All the communications between these processes means that Selenium tests take a long time to run. Which takes us to our next point:<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s Fast!<\/span><\/h2>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=mk7VWcuVOf0\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3667 size-full\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-2.png\" alt=\"They've gone plaid\" width=\"1600\" height=\"867\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">This in-browser execution is at the basis of the speed of Cypress testing. With Cypress, you have just one process: the browser itself. With Cypress, your test code is running alongside your application code. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">So an automation command (e.g., clicking a button) does not send the command to the browser like WebDriver does through <\/span><a href=\"https:\/\/stackoverflow.com\/questions\/5113650\/difference-between-in-process-and-out-process-service\"><span style=\"font-weight: 400;\">out-of-process communication<\/span><\/a><span style=\"font-weight: 400;\">. Instead, Cypress uses <\/span><a href=\"https:\/\/www.khanacademy.org\/computing\/computer-programming\/html-css-js\/html-js-dom-events\/a\/dom-event-types\"><span style=\"font-weight: 400;\">DOM events<\/span><\/a><span style=\"font-weight: 400;\"> to send a click command to the button. Much MUCH faster.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">And while WebDriver\u2019s out of process automation involves asynchronous communication, Cypress\u2019 automation commands are mostly synchronous and in-memory. This generates extremely fast tests.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I believe that it is this speed that is the main reason that frontend developers are enamored with Cypress. WebDriver, at least perception-wise, did not give them the speed that they needed. Frontend developers want to run their tests ALL THE TIME, and cannot afford the luxury of a suite that takes tens of minutes to run. They want to run their suite, and they need it to run in a minute or two, not more.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Is this speed difference <\/span><i><span style=\"font-weight: 400;\">really<\/span><\/i><span style=\"font-weight: 400;\"> substantial as Cypress\u2019 documentation claims? From my admittedly small experiments, then yes, but I am not convinced that the difference is worth the other benefits WebDriver has. Try it yourself on a small sample of tests, and see for yourself!<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It Has Built-In Server Mocking!<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3666\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/unnamed-2.png\" alt=\"Built-in Mocking\" width=\"832\" height=\"556\"><\/p>\n<p><span style=\"font-weight: 400;\">But there is another reason that Cypress is perceived as faster. Let\u2019s remind ourselves that Cypress is meant for frontend developers. Let\u2019s also remind ourselves that frontend developers sometimes don\u2019t use the real backend, but rather mock the <\/span><a href=\"https:\/\/www.w3schools.com\/xml\/xml_http.asp\"><span style=\"font-weight: 400;\">XML HttpRequests<\/span><\/a><span style=\"font-weight: 400;\"> to the server. This makes for extremely fast tests, on the order of seconds, regardless of whether you use Cypress or Selenium WebDriver.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Cypress understands that, and has <\/span><a href=\"https:\/\/docs.cypress.io\/api\/commands\/server.html#Syntax\"><span style=\"font-weight: 400;\">built-in facilities for mocking server responses<\/span><\/a><span style=\"font-weight: 400;\">, facilities that are crucial for their target audience: frontend developers. Selenium WebDriver has no facilities for that, and to mock server responses, a WebDriver tests would need to run a mock server that returns the correct responses. While possible, it is a slower and much less convenient option: a fast and in-memory facility for mocking will always outperform a slow out of process one.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">And it\u2019s not only the speed of execution. The convenience of a built-in facility for mocking servers cannot be overstated in terms of speed of writing the tests. The fact that each test explicitly describes the mock responses is much easier to code (and understand!) than a separate server program that mocks the same responses.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It Has a Bizarre Execution Model!<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3665\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/unnamed-3.png\" alt=\"\" width=\"783\" height=\"480\"><\/p>\n<p><span style=\"font-weight: 400;\">Yeah, I know. Weird heading for this section. But it does! Cypress\u2019 execution model is bizarre! To prove it, let me show you some Cypress sample code:<\/span><\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/giltayar\/846ba1bc906285b22f042ece7595dcbe.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/giltayar\/846ba1bc906285b22f042ece7595dcbe\">Gist<\/a>.<\/noscript><\/div>\n<p><span style=\"font-weight: 400;\">\u201cThat\u2019s not bizarre!\u201d, you say, and you would be right if it did what you thought it did. But it doesn\u2019t. When you call `cy.click` or `cy.navigate` or `cy.type`, you\u2019re not executing that command. You\u2019re actually recording what you want done when Cypress <\/span><i><span style=\"font-weight: 400;\">does<\/span><\/i><span style=\"font-weight: 400;\"> run the test. The test doesn\u2019t run inside the `it` function. It runs <\/span><i><span style=\"font-weight: 400;\">after<\/span><\/i><span style=\"font-weight: 400;\"> the `it` function ends, based on the commands you recorded. `cy.nagivate\/click\/type` don\u2019t <\/span><i><span style=\"font-weight: 400;\">execute<\/span><\/i><span style=\"font-weight: 400;\">, but rather <\/span><i><span style=\"font-weight: 400;\">record<\/span><\/i><span style=\"font-weight: 400;\">, to be replayed later.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">What are the practical consequences of that decision for the developer? If you want to branch your code based on a value in the page, you can\u2019t. For example, let\u2019s say you want to do something like this, to execute some test code based on the value of text on the page:<\/span><\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/giltayar\/f13c40f3133f43b23aceb276104b5d44.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/giltayar\/f13c40f3133f43b23aceb276104b5d44\">Gist<\/a>.<\/noscript><\/div>\n<p><span style=\"font-weight: 400;\">This won\u2019t work. Because when running the test, you\u2019re not actually executing the automation commands, and so checking for the value of the text is irrelevant.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Cypress <\/span><i><span style=\"font-weight: 400;\">does<\/span><\/i><span style=\"font-weight: 400;\"> support this kind of test, but in a byzantine way:<\/span><\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/giltayar\/427b8f2461f80763e5f80c9b949567a6.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/giltayar\/427b8f2461f80763e5f80c9b949567a6\">Gist<\/a>.<\/noscript><\/div>\n<p><span style=\"font-weight: 400;\">The `.then` facility enables you to supply code that \u201creally\u201d runs when Cypress executes the automation commands. This `.then` solves the problem of branched test execution in a \u201crecord-then-execute\u201d model, but would not have been needed if Cypress had followed a regular execution model, like WebDriver does.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So why does Cypress have this byzantine execution model? The answer to that lies in the next section.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s Less Flaky!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">According to Cypress, by delegating execution commands like navigate, click, and type, to Cypress itself, Cypress enables more control on <\/span><i><span style=\"font-weight: 400;\">how<\/span><\/i><span style=\"font-weight: 400;\"> to execute those commands. It can, for example, when asked to click on a button, wait for that button to appear on the screen, stop animation, and then, and only then will it click it.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">According to Cypress, this results in much less flaky tests.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I\u2019m not convinced.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Waiting for an element to appear sounds a lot like <\/span><a href=\"https:\/\/www.seleniumhq.org\/docs\/04_webdriver_advanced.jsp\"><span style=\"font-weight: 400;\">WebDriver\u2019s implicit wait<\/span><\/a><span style=\"font-weight: 400;\">, so I\u2019m not sure why Cypress believes it is better in that regard.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But I <\/span><i><span style=\"font-weight: 400;\">do<\/span><\/i><span style=\"font-weight: 400;\"> believe Cypress is less flaky, but this has nothing to do with controlling the execution. 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.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So, yes, I believe that Cypress <\/span><i><span style=\"font-weight: 400;\">is<\/span><\/i><span style=\"font-weight: 400;\"> less flaky, but not because of control of execution. Too bad, the byzantine method of execution detracts somewhat from this wonderful tool.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But I may be wrong! \ud83d\ude42<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">It\u2019s Interactive!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">One of the biggest coolnesses that Cypress has is also a big part of the reasons lots of developers flock to it: it\u2019s an <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Integrated_development_environment\"><span style=\"font-weight: 400;\">IDE<\/span><\/a><span style=\"font-weight: 400;\"> of sorts. Because Cypress fully controls the execution environment (the browser), it can give developers a more interactive experience:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3664\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-3.png\" alt=\"\" width=\"1600\" height=\"1153\"><\/p>\n<p><span style=\"font-weight: 400;\">As you can see in the screenshot, when the test runs, the commands that are executed are shown in the side panel, while they are being executed. Moreover, 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 <\/span><a href=\"https:\/\/docs.cypress.io\/guides\/getting-started\/writing-your-first-test.html#Time-travel\"><span style=\"font-weight: 400;\">Time traveling<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is phenomenal for debugging a test! <\/span><a href=\"https:\/\/docs.cypress.io\/guides\/guides\/screenshots-and-videos.html#Screenshots\"><span style=\"font-weight: 400;\">Cypress screenshots<\/span><\/a><span style=\"font-weight: 400;\"> and seeing how your tests progress is a marvelous way to debug the tests, and a marvelous way to start to understand why the test failed. The whole experience helps in writing, understanding, and debugging tests, and in analyzing their results.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Its Documentation is Excellent!<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Compare <\/span><a href=\"https:\/\/docs.cypress.io\/guides\/overview\/why-cypress.html#In-a-nutshell\"><span style=\"font-weight: 400;\">Cypress\u2019 documentation<\/span><\/a><span style=\"font-weight: 400;\">\u2026<\/span><\/p>\n<p><a href=\"https:\/\/docs.cypress.io\/guides\/overview\/why-cypress.html#In-a-nutshell\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3675 size-full\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/Screenshot-2018-10-15-22.37.16.png\" alt=\"Cypress documentation example\" width=\"1439\" height=\"798\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">&#8230;to <\/span><a href=\"https:\/\/www.seleniumhq.org\/docs\/\"><span style=\"font-weight: 400;\">Selenium\u2019s documentation<\/span><\/a><span style=\"font-weight: 400;\">:<\/span><\/p>\n<p><a href=\"https:\/\/www.seleniumhq.org\/docs\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3674 size-full\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/Screenshot-2018-10-15-22.37.55.png\" alt=\"Selenium documentation example\" width=\"1156\" height=\"713\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">When you review Cypress documentation, it looks a lot nicer. But it\u2019s not just what the documentation looks like. Cypress\u2019 documentation is much more in-depth and broad. It covers most of what you want to know, without the need to go looking elsewhere on the web. You can see that the developers spent a lot of time on the documentation itself. Kudos to them, as it enhances the experience in a significant manner.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Selenium\u2019s documentation is pretty good, especially given that it has a much more wider net to throw\u2014both because it is multi-language, and because it is multi-browser. Unfortunately, it carries with it the weight of previous years and is not equal to Cypress\u2019, both in depth and in width.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">As you can see, on the surface, although the two tools Cypress and Selenium WebDriver\u2014seem similar, there are actually many differences between the two. The main reason for the differences, in my opinion, stem from the different requirements from the two tools: Selenium was built as a multi-language, cross-browser tool, that fits multiple purposes, not just testing. Cypress, on the other hand, was built for one thing, and one thing only, executing frontend developers tests fast and consistently.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">That is why Cypress seems so limited: it supports just one language (JavaScript), one framework (Mocha), and one browser (Chrome). Selenium WebDriver does not have these limitations. It cannot have these limitations because it is a general purpose tools for multiple target audiences. But these limitations are mostly not a problem for frontend developers, and enable Cypress to give frontend developers the advantages that they <\/span><i><span style=\"font-weight: 400;\">do<\/span><\/i><span style=\"font-weight: 400;\"> need: speed and consistency.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Cypress is a classic example of less is more, while Selenium WebDriver is a classic example of a Swiss Army knife.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3661 size-full\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png\" alt=\"Cypress vs. Selenium\" width=\"1003\" height=\"445\"><\/p>\n<p><span style=\"font-weight: 400;\">Which is better for you: Cypress or Selenium? You tell me in the comments! <\/span><\/p>\n<p><span style=\"font-weight: 400;\">One thing I do know is that my company, Applitools, has SDKs and tutorials for how to do visual UI testing with <\/span><a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/cypress.html\"><span style=\"font-weight: 400;\">Cypress<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/selenium-java.html\"><span style=\"font-weight: 400;\">Selenium<\/span><\/a><span style=\"font-weight: 400;\">. So whichever you choose for test automation, we got you covered.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There\u2019s a new claim to the throne of functional test automation tools: Cypress.io. Is Cypress fast? Yes. Is Cypress interactive? Yep. Is Cypress reliable? You bet. And best of all\u2026&#8230;<\/p>\n","protected":false},"author":17,"featured_media":13661,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10004],"tags":[10357,10085,10358,10139,10847],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cypress vs Selenium WebDriver: Better, or just different? | Applitools<\/title>\n<meta name=\"description\" content=\"Is Cypress better than Selenium WebDriver? Compare the pros and cons here and find out which one might be best for you.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cypress vs Selenium WebDriver: Better, or just different?\" \/>\n<meta property=\"og:description\" content=\"There\u2019s a new claim to the throne of functional test automation tools: Cypress.io. Is Cypress fast? Yes. Is Cypress interactive? Yep. Is Cypress reliable?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\" \/>\n<meta property=\"og:site_name\" content=\"AI-Powered End-to-End Testing | Applitools\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-16T05:49:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-06T00:27:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1003\" \/>\n\t<meta property=\"og:image:height\" content=\"445\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Gil Tayar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gil Tayar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\"},\"author\":{\"name\":\"Gil Tayar\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/c9e99fab0bd2081a6a36861d9ca78a12\"},\"headline\":\"Cypress vs Selenium WebDriver: Better, or just different?\",\"datePublished\":\"2018-10-16T05:49:56+00:00\",\"dateModified\":\"2021-03-06T00:27:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\"},\"wordCount\":2916,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png\",\"keywords\":[\"Cypress\",\"Javascript\",\"Mocha\",\"Selenium\",\"WebdriverIO\"],\"articleSection\":[\"Advanced Topics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\",\"name\":\"Cypress vs Selenium WebDriver: Better, or just different? | Applitools\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png\",\"datePublished\":\"2018-10-16T05:49:56+00:00\",\"dateModified\":\"2021-03-06T00:27:40+00:00\",\"description\":\"Is Cypress better than Selenium WebDriver? Compare the pros and cons here and find out which one might be best for you.\",\"breadcrumb\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png\",\"width\":1003,\"height\":445},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advanced Topics\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cypress vs Selenium WebDriver: Better, or just different?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"name\":\"Applitools Visual AI\",\"description\":\"Applitools delivers full end-to-end test automation with AI infused at every step.\",\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\",\"name\":\"Applitools\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"width\":156,\"height\":28,\"caption\":\"Applitools\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/c9e99fab0bd2081a6a36861d9ca78a12\",\"name\":\"Gil Tayar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/566240e52d34470d5e766e232d5d59a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/566240e52d34470d5e766e232d5d59a9?s=96&d=mm&r=g\",\"caption\":\"Gil Tayar\"},\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/gil_t\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Cypress vs Selenium WebDriver: Better, or just different? | Applitools","description":"Is Cypress better than Selenium WebDriver? Compare the pros and cons here and find out which one might be best for you.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/","og_locale":"en_US","og_type":"article","og_title":"Cypress vs Selenium WebDriver: Better, or just different?","og_description":"There\u2019s a new claim to the throne of functional test automation tools: Cypress.io. Is Cypress fast? Yes. Is Cypress interactive? Yep. Is Cypress reliable?","og_url":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/","og_site_name":"AI-Powered End-to-End Testing | Applitools","article_published_time":"2018-10-16T05:49:56+00:00","article_modified_time":"2021-03-06T00:27:40+00:00","og_image":[{"width":1003,"height":445,"url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png","type":"image\/png"}],"author":"Gil Tayar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gil Tayar","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#article","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/"},"author":{"name":"Gil Tayar","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/c9e99fab0bd2081a6a36861d9ca78a12"},"headline":"Cypress vs Selenium WebDriver: Better, or just different?","datePublished":"2018-10-16T05:49:56+00:00","dateModified":"2021-03-06T00:27:40+00:00","mainEntityOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/"},"wordCount":2916,"commentCount":0,"publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png","keywords":["Cypress","Javascript","Mocha","Selenium","WebdriverIO"],"articleSection":["Advanced Topics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/","url":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/","name":"Cypress vs Selenium WebDriver: Better, or just different? | Applitools","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png","datePublished":"2018-10-16T05:49:56+00:00","dateModified":"2021-03-06T00:27:40+00:00","description":"Is Cypress better than Selenium WebDriver? Compare the pros and cons here and find out which one might be best for you.","breadcrumb":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#primaryimage","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/10\/pasted-image-0-4.png","width":1003,"height":445},{"@type":"BreadcrumbList","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-vs-selenium-webdriver-better-or-just-different\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/app14743.cloudwayssites.com\/"},{"@type":"ListItem","position":2,"name":"Advanced Topics","item":"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/"},{"@type":"ListItem","position":3,"name":"Cypress vs Selenium WebDriver: Better, or just different?"}]},{"@type":"WebSite","@id":"https:\/\/app14743.cloudwayssites.com\/#website","url":"https:\/\/app14743.cloudwayssites.com\/","name":"Applitools Visual AI","description":"Applitools delivers full end-to-end test automation with AI infused at every step.","publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/app14743.cloudwayssites.com\/#organization","name":"Applitools","url":"https:\/\/app14743.cloudwayssites.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","width":156,"height":28,"caption":"Applitools"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/c9e99fab0bd2081a6a36861d9ca78a12","name":"Gil Tayar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/566240e52d34470d5e766e232d5d59a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/566240e52d34470d5e766e232d5d59a9?s=96&d=mm&r=g","caption":"Gil Tayar"},"url":"https:\/\/app14743.cloudwayssites.com\/blog\/author\/gil_t\/"}]}},"_links":{"self":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/13660"}],"collection":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/comments?post=13660"}],"version-history":[{"count":0,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/13660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media\/13661"}],"wp:attachment":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media?parent=13660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/categories?post=13660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/tags?post=13660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}