DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Migrate, Modernize and Build Java Web Apps on Azure: This live workshop will cover methods to enhance Java application development workflow.

Modern Digital Website Security: Prepare to face any form of malicious web activity and enable your sites to optimally serve your customers.

Kubernetes in the Enterprise: The latest expert insights on scaling, serverless, Kubernetes-powered AI, cluster security, FinOps, and more.

A Guide to Continuous Integration and Deployment: Learn the fundamentals and understand the use of CI/CD in your apps.

Related

  • Comparative Analysis of Open Source Cluster Management Systems: Kubernetes vs. Apache Mesos
  • What Role Will Open-Source Hardware Play in Future Designs?
  • How To Add Audio Animations to Android Apps
  • Why It Will Always Be Hard To Write Useful Software

Trending

  • Should I Start My Job Search Now?
  • Decompose Legacy System Into Microservices: Part 2
  • Advanced Content Prioritization Techniques for Web Developers
  • A Modern Open-Source Technology That Conquers ACH Batch Processing
  1. DZone
  2. Popular
  3. Open Source
  4. Selenium vs. Watir

Selenium vs. Watir

Learn about the features and advantages of these two tools that will help you choose between them for your test automation framework.

Federico Toledo user avatar by
Federico Toledo
·
Mar. 29, 18 · Opinion
Like (7)
Save
Tweet
Share
15.0K Views

Join the DZone community and get the full member experience.

Join For Free

I recently got started on a client project in which I’m putting together an automation framework, where, luckily, I’ve 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 Selenium vs Watir.

Image title

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.

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.

Language

If it were for me, I would program in Java, since that is what I have more experience in, but the client’s team programs in Ruby. But, that’s 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’t a minor one— as testers, we should always seek to team up with developers, and not go in a separate direction from them with our technological stack.

We’re all on the same team, right?

Automation Tool: Selenium vs Watir

I started to investigate a bit, focusing on open source web browser automation tools for Ruby that integrate with:

  • Cucumber (when thinking about BDD)
  • BrowserStack or SauceLabs for cross-browser testing
  • Applitools for visual testing

Here’s a small comparison chart. I also threw Capybara into the ring (but for my purposes, it had much less fighting power than the others).



Watir

Capybara

Selenium

Language Approach

Object oriented

DSL

Object oriented

Original release

2008

2009

2004

Popularity today

Worst

2nd best

Best

Active? Last release

2 weeks ago

1 month ago

2 months ago

Ease of maintaining test cases

1st (uses Selenium under the hood, providing a better API)

Worst (read discussion)

2nd, very similar to Watir

Cucumber Integration

Yes

Yes

Yes

BrowserStack and SauceLabs integration

Yes

Yes

Yes

Page Object pattern

Yes

Yes

Yes

Browsers

Chrome

Firefox

Edge

IE

Safari

Uses different drivers, including Selenium, so I guess that the same browsers are supported.

Firefox latest releases.

IE 7-11

Safari 5.1+

Opera

Chrome

Edge

Headless browsers

Yes

Yes

Yes

Locators

Id, Name, CSS selectors, XPath

Id, Name, CSS selectors, XPath

Id, Name, CSS selectors, XPath


My conclusion, for now, is that there aren’t 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:

  • Better support (a greater community implies more forums, more resources, examples, problems solved).
  • It’s more likely you’ll find someone with experience in Selenium than in Watir (although knowing one, it doesn’t take long to learn the other).
  • It’s more popular and more accepted. Every time I tell someone that I’m going to use Watir, I end up saying, “It’s something similar to Selenium.” Why not just use Selenium?
  • The reason why someone recommended Watir to me is that it has an API that makes it easier to read, I am not convinced that it really does make it much easier.

So, for now, I am choosing Selenium…

What would you do if faced with having to choose between Selenium or Watir? Leave me a comment below!

Open source

Published at DZone with permission of Federico Toledo, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Comparative Analysis of Open Source Cluster Management Systems: Kubernetes vs. Apache Mesos
  • What Role Will Open-Source Hardware Play in Future Designs?
  • How To Add Audio Animations to Android Apps
  • Why It Will Always Be Hard To Write Useful Software

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: