{"id":9798,"date":"2018-03-26T00:53:31","date_gmt":"2018-03-26T00:53:31","guid":{"rendered":"http:\/\/abstracta.us\/blog\/?p=9798"},"modified":"2025-05-05T21:20:31","modified_gmt":"2025-05-05T21:20:31","slug":"selenium-vs-watir","status":"publish","type":"post","link":"https:\/\/abstracta.us\/blog\/test-automation\/selenium-vs-watir\/","title":{"rendered":"Selenium vs Watir"},"content":{"rendered":"<p><!-- Go to www.addthis.com\/dashboard to customize your tools --><script src=\"\/\/s7.addthis.com\/js\/300\/addthis_widget.js#pubid=ra-58d80a50fc4f926d\" type=\"text\/javascript\"><\/script><\/p>\n<h1><span style=\"font-weight: 400;\">Choosing between these two test automation tools for an automation framework<\/span><\/h1>\n<p><span style=\"font-weight: 400;\">I recently got started on a client project in which I\u2019m putting together an automation framework, where, luckily, I\u2019ve been given some objectives that are quite clear to fulfill. I want to discuss one of the things that I am considering in regards to the project (in case anyone has some helpful insights!) which is: What automation tool should I use? In the ring, I have <\/span><a href=\"https:\/\/www.seleniumhq.org\/\"><span style=\"font-weight: 400;\">Selenium<\/span><\/a><span style=\"font-weight: 400;\"> vs <\/span><a href=\"http:\/\/watir.com\/\"><span style=\"font-weight: 400;\">Watir<\/span><\/a><span style=\"font-weight: 400;\">. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">On the one hand, Selenium seems to me the most natural option, the most popular open source tool for web browser automation. The de facto standard. But, when I was discussing it with my colleagues at Abstracta, they recommended Watir, which is better for Ruby.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So, I started to investigate a little more. Before I start comparing the two tools, I would like to comment on why this particular language choice.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Language\"><\/span>Language<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If it were for me, I would program in Java, since that is what I have more experience in, but the client\u2019s team programs in Ruby. But, that\u2019s okay, I can be flexible! Since I hope that the developers consider automation as a value-add to them in the future which they can extend, maintain, improve, utilize, etc., I prefer to stick with Ruby. Even though with automation, when taking a black box approach, the language used for the system code is less important. Anyway, this argument isn\u2019t a minor one\u2014 as testers, we should always seek to team up with developers, and not go in a separate direction from them with our technological stack. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">We\u2019re all on the same team, right?<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Automation_Tool_Selenium_vs_Watir\"><\/span>Automation Tool: Selenium vs Watir<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">I started to investigate a bit, focusing on open source web browser automation tools for Ruby that integrate with:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/cucumber.io\/\"><span style=\"font-weight: 400;\">Cucumber<\/span><\/a><span style=\"font-weight: 400;\"> (when thinking about <\/span><a href=\"https:\/\/www.agilealliance.org\/glossary\/bdd\/\"><span style=\"font-weight: 400;\">BDD<\/span><\/a><span style=\"font-weight: 400;\">) <\/span><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/www.browserstack.com\/\"><span style=\"font-weight: 400;\">BrowserStack<\/span><\/a><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/saucelabs.com\/\"><span style=\"font-weight: 400;\">SauceLabs<\/span><\/a><span style=\"font-weight: 400;\"> for cross-browser testing, <\/span><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/applitools.com\/\"><span style=\"font-weight: 400;\">Applitools<\/span><\/a><span style=\"font-weight: 400;\"> for visual testing<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Here\u2019s a small comparison chart. I also threw Capybara into the ring (but for my purposes, it had much less fighting power than the others).<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Watir<\/b><\/td>\n<td><b>Capybara<\/b><\/td>\n<td><b>Selenium<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Language Approach<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Object oriented <\/span><\/td>\n<td><span style=\"font-weight: 400;\">DSL<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Object oriented<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Original release<\/b><\/td>\n<td><span style=\"font-weight: 400;\">2008<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2009<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2004<\/span><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.ruby-toolbox.com\/categories\/browser_testing\" target=\"_blank\" rel=\"noopener\"><b>Popularity<\/b><\/a><\/td>\n<td><span style=\"font-weight: 400;\">3rd<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2nd<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1st<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Active? Last release<\/b><\/td>\n<td><span style=\"font-weight: 400;\">2 weeks ago<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1 month ago<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2 month ago<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Ease of maintaining test cases<\/b><\/td>\n<td><span style=\"font-weight: 400;\">1st (uses Selenium under the hood, providing a better API)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Worst (<\/span><a href=\"https:\/\/github.com\/watir\/watir\/issues\/444\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">read discussion<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2nd<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Cucumber Integration<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>BrowserStack and SauceLabs integration<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td><a href=\"https:\/\/github.com\/browserstack\/capybara-browserstack\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Yes<\/span><\/a><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Page Object pattern<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td><a href=\"https:\/\/robots.thoughtbot.com\/better-acceptance-tests-with-page-objects\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Yes<\/span><\/a><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Browsers<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Chrome<\/span><br \/>\n<span style=\"font-weight: 400;\">Firefox<\/span><br \/>\n<span style=\"font-weight: 400;\">Edge<\/span><span style=\"font-weight: 400;\">Internet Explorer<\/span><span style=\"font-weight: 400;\">Safari<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Uses different drivers, including Selenium<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Firefox latest releases.<\/span><br \/>\n<span style=\"font-weight: 400;\">Internet Explorer 7-11.<\/span><br \/>\n<span style=\"font-weight: 400;\">Safari 5.1+<\/span><span style=\"font-weight: 400;\">Opera <\/span><span style=\"font-weight: 400;\">Chrome<\/span><span style=\"font-weight: 400;\">Edge<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Headless browsers<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Locators<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Id, Name, CSS selectors, XPath<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Id, Name, CSS selectors, XPath<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Id, Name, CSS selectors, XPath<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">My conclusion, for now, is that there aren\u2019t any big differences between Selenium and Watir. While I started out wanting to go with Watir, there are other factors that make me think about switching to Selenium:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Better support (a greater community implies more forums, more resources, examples, problems solved).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It\u2019s more likely you\u2019ll find someone with experience in Selenium than in Watir (although knowing one, it doesn\u2019t take long to learn the other).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It\u2019s <\/span><span style=\"font-weight: 400;\">more popular and more accepted. Every time I tell someone that I&#8217;m going to use Watir, I end up saying, &#8220;It&#8217;s something similar to Selenium.&#8221; Why not just use Selenium?<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The reason why someone recommended Watir to me is because it has an API that makes it easier to read, I am not convinced that it really does make it much easier.<\/span><\/li>\n<\/ul>\n<p><b>So, for now I am choosing Selenium\u2026 <\/b><\/p>\n<p><span style=\"font-weight: 400;\">What would you do if faced with having to choose between Selenium or Watir? Leave me a comment below!<\/span><\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Recommended_for_You\"><\/span>Recommended for You<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"http:\/\/abstracta.us\/blog\/test-automation\/the-4-most-common-test-automation-challenges-and-how-to-overcome-them\/\">The 4 Most Common Test Automation Challenges (and How to Overcome Them)<\/a><br \/>\n<a href=\"http:\/\/abstracta.us\/blog\/test-automation\/regaining-confidence-in-automated-tests\/\">Losing and Regaining Confidence in Automated Tests<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Choosing between these two test automation tools for an automation framework I recently got started on a client project in which I\u2019m putting together an automation framework, where, luckily, I\u2019ve been given some objectives that are quite clear to fulfill. I want to discuss one&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,61],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Selenium vs Watir Test Automation Tools Review | Abstracta<\/title>\n<meta name=\"description\" content=\"In a recent test automation project, we had to evaluate which tool to use, Selenium vs Watir. See how we compared the two tools&#039; features, advantages, etc!\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selenium vs Watir Test Automation Tools Review | Abstracta\" \/>\n<meta property=\"og:description\" content=\"In a recent test automation project, we had to evaluate which tool to use, Selenium vs Watir. See how we compared the two tools&#039; features, advantages, etc!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog about AI-powered quality engineering for teams building complex software | Abstracta\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AbstractaQA\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-26T00:53:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-05T21:20:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/abstracta.us\/wp-content\/uploads\/2018\/03\/selenium-vs-watir.png\" \/>\n\t<meta property=\"og:image:width\" content=\"560\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fltoledo\" \/>\n<meta name=\"twitter:site\" content=\"@AbstractaUS\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/abstracta.us\/blog\/#website\",\"url\":\"https:\/\/abstracta.us\/blog\/\",\"name\":\"Blog about AI-powered quality engineering for teams building complex software | Abstracta\",\"description\":\"AI-powered quality engineering\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/abstracta.us\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/#webpage\",\"url\":\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/\",\"name\":\"Selenium vs Watir Test Automation Tools Review | Abstracta\",\"isPartOf\":{\"@id\":\"https:\/\/abstracta.us\/blog\/#website\"},\"datePublished\":\"2018-03-26T00:53:31+00:00\",\"dateModified\":\"2025-05-05T21:20:31+00:00\",\"author\":{\"@id\":\"https:\/\/abstracta.us\/blog\/#\/schema\/person\/7421e539de0357d3adb0c69ed469a1c2\"},\"description\":\"In a recent test automation project, we had to evaluate which tool to use, Selenium vs Watir. See how we compared the two tools' features, advantages, etc!\",\"breadcrumb\":{\"@id\":\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/\",\"url\":\"https:\/\/abstracta.us\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/testing-tools\/\",\"url\":\"https:\/\/abstracta.us\/blog\/testing-tools\/\",\"name\":\"Testing Tools\"}},{\"@type\":\"ListItem\",\"position\":3,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/\",\"url\":\"https:\/\/abstracta.us\/blog\/testing-tools\/selenium-vs-watir\/\",\"name\":\"Selenium vs Watir\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/abstracta.us\/blog\/#\/schema\/person\/7421e539de0357d3adb0c69ed469a1c2\",\"name\":\"Federico Toledo, Chief Quality Officer at Abstracta\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/abstracta.us\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6de7ec6536c4028b5c02ad4ec1b9af0d?s=96&d=blank&r=g\",\"caption\":\"Federico Toledo, Chief Quality Officer at Abstracta\"},\"description\":\"Co-founder and COO of Abstracta\",\"sameAs\":[\"https:\/\/twitter.com\/fltoledo\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/9798"}],"collection":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/comments?post=9798"}],"version-history":[{"count":13,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/9798\/revisions"}],"predecessor-version":[{"id":17502,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/9798\/revisions\/17502"}],"wp:attachment":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/media?parent=9798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/categories?post=9798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/tags?post=9798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}