Why I Prefer Ruby As E2E Test Automation Scripting Language? Part 1
The Objective Ruby Features Good for Scripting
Some readers may know that I work as a Software Engineer professionally and the programming languages I use at work are Java, JavaScript and Kotlin. The nature of my work is back-end, in other words, E2E (UI) Test Automation is rarely used at work. Long-time readers know that I am practising E2E Test Automation because of the influence of my father.
The above information is to show that other than Ruby, I do know a few other languages. And the reason why I like Ruby as an ideal E2E scripting language is (somewhat) objective.
1. Ruby is a scripting language.
Test scripts shall be in a scripting language, naturally.
2. Ruby is a 100% Object-Oriented Language, Java is not.
In Ruby, everything is an object.
puts 1.class # => Integer
We can’t do that in Java, as 1
is a primitive type.
Why does this matter? It doesn’t really, but it is more consistent. By the way, Page Object Model (using the OO concept) is the most widely pattern in the E2E test script.
3. Ruby is concise
Ruby is known for its conciseness. Let’s see the implementation of Hello World.
puts "Hello world!"
Java version:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
4. Ruby tops in terms of readability
Readability might not be a top consideration for coding, but for E2E test scripting is essential. Besides being well-known for being concise, Ruby is also well-known for its readability.
Here I will just show one simple example.
sign_in "agileway", "testwise"
driver.quit unless is_in_debugging_mode?
The ?
is not usually not allowed in function names.
Another feature is Ruby Symbol, e.g. :name
. For people who don’t know Ruby, you can treat a Symbol as a string. What’s the use then? Let me illustrate with an example.
In most languages, Selenium test scripts start like below:
Ignore the language specifics, just focus on the readability. Is it quite good, right?
In Ruby, we have another option to show strings. It is called “Symbols”, like the :all
and :each
below.
Don’t you think this readability is improved?
5. Ruby syntax is intuitive
The ‘conciseness” and “readability” of Ruby is objective, I like Ruby syntax for its intuitiveness. The reason is the language was designed with “Least Surprise’ principle: “The language should behave in a way that minimizes confusion for experienced users”.
“Ruby’s syntax and behaviors are designed to be intuitive, so programmers can focus on problem-solving rather than language complexities.” — a blogger”
6. Ruby’s only shortcoming “speed” matters little in E2E testing
Many programmers dismiss Ruby by saying, “Ruby is slow” (compared to compiled languages), which is true. However, in terms of raw performance, Ruby 3 is on par with or slightly faster than Python—and Python’s speed limitations haven’t stopped it from becoming the #1 language for AI. Major websites like Airbnb, Shopify, Basecamp, Hey, and GitHub run on Ruby, and I’d wager that most developers' applications don’t come close to requiring even 1% of their performance.
When it comes to end-to-end (E2E) testing, speed is even less of a concern, as most delays come from the application itself, network latency, and framework overhead rather than the test script’s execution time.
Besides, Watir (Web Application Testing in Ruby) pioneered browser-based test automation around 2004—when Ruby 1.8 was far slower than Ruby 3—yet few complained about its speed back then.

In Part 2, I will explore more great Ruby features in the context of E2E Testing.
Related reading: